Simon Alexander Bennett, 44, was sentenced for manslaughter following the death of Elliot Handley in Dorchester last year.
Bennett, of Dorchester, appeared at Winchester Crown Court on Monday 25 July 2016. He was detained for further treatment under section 37 of the Mental Health act 1983 and restriction orders under section 41 of the Mental Health Act 1983 until he no longer presents a danger to society.
He previously admitted the charge of manslaughter on the grounds of diminished responsibility at a hearing held at Winchester Crown Court on 21 March this year.
The court heard that Elliot’s body was discovered in Bennett’s first floor flat in Compass House in The Grove at around 9.50pm on 26 May 2015.
An investigation was launched by Dorset Police’s Major Crime Investigation Team (MCIT) and Bennett was arrested on the same day on suspicion of Elliot’s murder following the discovery of his body. He was charged with Elliot’s murder on 6 September 2015.
A post mortem examination revealed that Elliot died of multiple blunt-force head injuries.
The scene was forensically examined over three days and a number of items were seized that are believed to have been used in the attack, including a claw hammer, a heavy metallic object and a bottle.
Senior investigating officer Detective Chief Inspector Neil Devoto, of Dorset Police’s MCIT, said: “Our thoughts today are with Elliot’s family who are being supported by family liaison officers.
“I hope today’s sentence brings some closure for them.
“They have asked for privacy at this difficult time.”