RAPID CITY, S.D. (AP) — A man accused of beating and strangling another man in Rapid City last year has pleaded guilty to manslaughter.

Nineteen-year-old Michael Hand earlier had pleaded not guilty by reason of insanity to murder in the July 2014 death of 47-year-old Myron Rock, whose body was found in an alley.

Hand was to stand trial next week, but he pleaded guilty to the reduced charge on Tuesday in a deal with prosecutors that caps his prison time at 25 years. He could have faced life behind bars had he been convicted of murder. He's to be sentenced Dec. 16.

Hand's confession statement says he struck Rock multiple times in a fit of anger. He says he didn't mean to kill Rock.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

More From KXRB