FORT WORTH (CBSDFW.COM) – A 17-year-old Fort Worth boy who admitted to bludgeoning a friend to death with a hammer has been sentenced to 26 years in prison.

The sentence is part of a plea agreement that was reached on Wednesday morning just before the teen’s trial was to begin in juvenile court.

The identity of the teen is not being released because the judge declined to try the teenager as an adult.

The crime occurred just after midnight on May 15, 2013, when the teen and 17-year-old Nicholas Anderson were at Glenwood Park in the 900 block of Riverside Drive.

The teen pulled out a hammer and repeatedly struck Anderson in the head and upper body. He then stole the victim’s watch, wallet, and car, which he drove to a friend’s house.

The friend then helped the teen move Anderson’s body to a heavily-wooded area at the park.

A homeless man found the body at 7 a.m. that morning, face-down in a group of bushes, and called for help.

“I’m just hoping that the senseless violence will stop,” said the victim’s grandmother, Lindia Thomas, “because my grandson, Nicholas Isaiah Anderson, lost his life on May 15 unnecessarily.”

The unidentified teen will begin his sentence with the Texas Juvenile Justice Department and could be transferred to an adult prison prior to his 19th birthday.

“If not for the hard work and diligence of Fort Worth Homicide Detective Kyle Sullivan, this case could have gone unsolved,” said Prosecutor Brock Groom, who handled the case with Sherri Wagner. “His efforts led to what I hope provides some measure of closure for the victim’s wonderful family.”

(©2014 CBS Local Media, a division of CBS Radio Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)