YANKTON, S.D. (AP) — A man accused of murdering his uncle in Yankton last year has pleaded guilty to manslaughter in a deal with prosecutors.

Joshua Hudson is accused of using a hammer to kill 46-year-old Todd Hudson in March 2014. He had pleaded not guilty by reason of insanity in April to charges including second-degree homicide.

The Daily Press and Dakotan reports that Hudson pleaded guilty to the reduced charge Tuesday.

Hudson could have faced life in prison if convicted on the initial charge. Under the plea deal, prosecutors will recommend a sentence of no more than 40 years. Sentencing is July 30.

Hudson underwent four psychiatric evaluations. Two concluded he was legally insane at the time of the killing. One concluded he was sane at the time, and one was inconclusive.

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

More From KXRB