A 17-year-old boy has been indefinitely detained in a psychiatric hospital after killing an academic using electric drills, knives and a hammer.

The teenager carried out a sustained attack on the lecturer after hearing voices in his head, Winchester crown court heard.

Dr Barry Hounsome, 54, died while trying to escape from the attack at his home in Gosport, Hampshire, on 29 October.

The academic, who previously worked at Southampton and Bangor universities, researched dementia and Parkinson’s disease.

The boy, who cannot be named for legal reasons, was due to stand trial for murder but the prosecution instead accepted a guilty plea to manslaughter by diminished responsibility.

Sentencing him to a hospital order under the Mental Health Act, Mr Justice Garnham said: “You killed him in the course of a vicious and ferocious attack. The evidence suggests you are riven with remorse for what you have done.

“I have no doubt that you were at the time of the attack, and that you remain, highly dangerous. Without medication, there’s a real risk of a similar event in the future.”

Kerry Maylin, prosecuting, told the court: “This was a sustained and prolonged attack. He said voices in his head had been telling him to kill. The night before the incident, the voice was telling him to kill someone.”

The boy left a note and made a video apologising for his actions, Maylin said. During the attack, Hounsome, who lived with his wife, Natalia, a senior lecturer in global health economics, tried to escape, but the boy pulled him back and forced him to the floor, the court heard.

He told the police that Hounsome had asked him: “Why?” and he replied: “I’m sorry.”

Afterwards, the voice told him: “You are done”, the court heard.

Maylin said the boy said he started hearing voices about 18 months previously, but had never told anyone about it.

Over time, the voices became “more manic, aggressive and demanding”, escalating from telling him to kill animals to carrying out attacks on random people, the court heard.

Maylin told the court that the boy said: “Something in my head kept telling me to do it. I didn’t want to do it. I tried to push myself away but I ended up doing it. I’m so sorry.”

He has been diagnosed with paranoid schizophrenia and is thought to have experienced a psychotic episode just before the attack, the court heard.