YORK, S.C. (AP) — A man who spent 18 years in a South Carolina prison is returning for 18 more years behind bars after admitting he beat a friend to death with a hammer one month after being released.

The Herald of Rock Hill reports that 39-year-old Jerod Juan Cook pleaded guilty Tuesday to voluntary manslaughter.

Prosecutors say Cook attacked 59-year-old John Ferrell II in his Rock Hill apartment in June 2020 and DNA linked the two men to each other.

Authorities say Cook was released from prison in May 2020 after serving 18 years for armed robbery, assault with intent to kill, burglary and other crimes.