A mentally ill man killed his father in a frenzied knife attack in front of his mother.

Ross Allen, 27, stabbed his victim 26 times in the garden of the family bungalow where his father had been sunbathing. Allen's mother, Mary, shouted at her son to stop and then ran to dial 999. Later, when asked what his intention had been when he went to the house, the first-time offender told police: "To commit murder. I never believed I was going to do it. I feel like I was not under control of my actions. I was not thinking. I was lost, out of my mind."

He was originally charged with the murder of his 55-year-old father Sandy at the home in Eskfield Grove, Dalkeith, Midlothian, on July 28 last year. But the Crown yesterday accepted his guilty plea to the reduced charge of culpable homicide on the grounds of diminished responsibility.

Advocate depute Gary Allan QC told the High Court in Edinburgh: "Mrs Allen has had the double trauma of the killing of her husband, committed in front of her by the son whom she loves.

"Both she and her daughter have turned their focus to what is going to be best for the accused and to his getting the help which he needs."

Allen's conviction follows a court case where another mentally ill man repeatedly knifed his father to death.

Gary Ward, 39, was found not guilty of murdering his father Jim, 62, on grounds of insanity. His mother Elizabeth, 64, said her son and estranged husband had been let down by the system.

The court yesterday heard that Allen developed psychotic symptoms in July 1998, when he had delusions that he had written all the songs by pop band Oasis.

On July 28, Mrs Allen went into Edinburgh with her husband. Allen, who was living in supported accommodation at Kilbreck House, in Loanhead, which is managed by Midlothian Council, let himself into his parents' house. His mother returned first, then his father.

The advocate depute said: "The deceased made reference to a small goatee beard grown by the accused and suggested he shave it off saying it did not suit him. The accused went to a bathroom and shaved it off."

Mr Allen went to a lounger in the garden. Allen went out for a cigarette while his mother was inside. "She heard screams, ran to the garden and saw the accused attacking the deceased with a knife," Mr Allan said.

Allen walked to a nearby garage and said he had been attacked.

Officers traced Allen, who said he was carrying a knife. "He said he had the knife and the reason was 24 years of abuse and mistreatment when he was spiked' with Milk of Magnesia which made his bones crack and break, making him weak," Mr Allan said.

Allen told police he had not slept nor taken his prescribed medication for about three days. He said he took cocaine before the attack.

A pathologist said the number of injuries, their severity and the force used suggested that the person responsible was "deranged".

It had previously not been thought he needed to be detained by his consultant psychiatrist. The advocate depute said the Crown accepted the "tragic killing" had to be regarded as culpable homicide because of the diminished responsibility of Allen who was acting under delusions which were part of a severe mental illness.

The judge, Lord Turnbull, continued the case for background and psychiatric reports on Allen, who is detained in the State Hospital at Carstairs.

Midlothian Council said Allen was given temporary accommodation in Kilbreck House, after being discharged from hospital in October 2006.

A council source said that this was a "temporary arrangement to provide support" before moving to permanent accommodation.

NHS Lothian refused to comment on any issues raised as a result of the case.