A man who repeatedly stabbed two police officers who went to his house to help admit him to hospital has been acquitted after a trial in Glasgow.

William Taylor, who suffers from mental health issues, appeared "unusually calm", after the attack.

The 43-year-old was charged with attempting to murder PCs Kenneth MacKenzie and Laura Sayer when they went to his flat at Gateside Gardens, Greenock, on June 1.

He repeatedly stabbed PC MacKenzie, 43, on the head and body, before following Constable Sayer, 39, out of his flat and stabbing her multiple times on the chest.

Taylor walked then out on to the street with the knife above his head and asked neighbours: "Do you want some of this?"

He was acquitted after appearing at the High Court in Glasgow on Wednesday however a compulsion order was imposed meaning he will be detained and continue to receive medical treatment from custody.

His defence QC, Dean of Faculty Gordon Jackson, said "I tender a plea which is, not guilty, on the basis that he was unable - because of a mental disorder - to appreciate the nature or wrongfulness of his conduct."

Advocate depute Martin Richardson QC said that was acceptable to the Crown and invited the judge to impose the compulsion order.

After hearing the narrative of the facts and evidence from consultant psychiatrist Dr Craig Marsh, who said it was clear Taylor's mental state was impaired at the time, judge Lord Burns acquitted Taylor and imposed the order.

He said: "I am satisfied that the compulsion order is required" and added: "It remains for me to commend the police officers here, in particular Constable MacKenzie and constable Sayer for the action they took."

The court heard Taylor has been in contact with mental health services since 1986 and was prescribed medication after being diagnosed with schizophrenia in April this year.

Two days before the incident with police, Taylor's parents visited him and found unopened medication and his house to be unusually untidy.

They were concerned he didn't appear well and the following day they went to see a member of the community mental health team who agreed to visit him.

The court heard a mental health worker visited and reported to consultant psychiatrist, Rajitha Jayawardena, that she thought he should be admitted to hospital.

It was decided to go to his house on June 1 and "it was believed he might require to be restrained" so the two officers went with mental health officer Angela Douglas and Dr Jayawardena.

Mr Richardson said: "It took a while for the accused to answer the door. On answering the accused asked what they wanted.

"Ms Douglas explained that they wanted to come in and speak to him.

"The accused then attempted to close the door. Constable MacKenzie put his foot in the door to prevent this and repeated that they would need to come in and speak to him."

They followed Taylor in who was "very disgruntled and angry" and said he was "not mental".

Taylor admitted to Dr Jayawardena he had not been taking his medication and was advised in order to restart it, he should come to hospital voluntarily.

He was told if he didn't he would be detained.

Mr Richardson continued: "At this, the accused jumped up from the sofa, pulled a knife out of the back of his trouser and lunged at Constable MacKenzie and struck him repeatedly with his left hand causing the police officer to fall back on to the sofa."

PC Sayer grabbed Taylor's arm and tried to pull him away but Taylor broke free and charged at her colleague again.

He pushed him into the kitchen and over the worktop and repeatedly struck him in the chest with the knife.

The court heard Taylor "appeared frantic", and at this point Constable Sayer used her spray on him but it had no effect.

She left the flat to get Taylor away from her colleague and he followed her to the ground floor and backed her into a wall and stabbed her repeatedly on the chest.

Mr Richardson added that PC MacKenzie heard the commotion and saw Taylor stabbing the officer on the body and ran to pull him off.

He said "The accused got Constable MacKenzie in a choke hold and started to strike him on the torso with the knife."

Constable Sayer saw she was bleeding and radioed for help while Taylor walked out on to the street and ignored the instruction to "drop the knife".

He passed two neighbours and waved the blade above his head and said something like: "Do you want some of this?"

The court heard Taylor removed his t-shirt and "appeared unusually calm" and made his way towards a police car that arrived on the street.

He was intentionally hit by the car in a bid to stop him getting at Constable MacKenzie, rolled on the bonnet and smashed the windscreen.

Taylor got up and tried to stab another officer then ran off towards a garden and was chased.

Eventually other officers caught up with him and restrained him and he was taken to Royal Alexandra Hospital, Paisley.

Mr Richardson said: "When he arrived he was informed that he was under arrest. He was formally cautioned and replied 'I'm sorry'."

Constable MacKenzie was later examined and found to have a wound on the left of his neck and a cut on his nose and right jawbone.

PC Sayer had surgery on her left upper arm with a 12cm wound that divided a nerve on her forearm.

She also suffered a cut on her right hand and will be left with a scar on her forearm and long-term altered sensation.

Mr Richardson said: "Both Constable MacKenzie, who had nine years police service, and Constable Sayer, who had only five and a half months service, have remained off work following the incident.

"It is unclear whether either officer will be able to return toward in the immediate future."