A mental health patient, found in possession of a 12in knife, is to be detained in a medium secure unit for the protection of himself and the public.

Gary Lees, 35, produced the weapon from his sleeve after police asked him to show them what he had got in his pockets, Bradford Crown Court was told yesterday.

Prosecutor Neil Donkin said Lees immediately put the knife down when asked to do so.

He told officers he had no excuse for carrying it and had it because he wanted to kill himself.

Lees, an inpatient at Lynfield Mount Hospital in Bradford, had been committed to the crown court by magistrates for sentencing in relation to five matters – shoplifting at Asda, and at two Bradford Tesco stores, in Canal Road and Halifax Road, possessing a bladed article, assaulting a police constable in the execution of his duty and an associated offence of criminal damage.

Mr Donkin said police were alerted by concerned members of the public, on February 11, that there was a man with a knife in a phone booth in Wibsey Park Avenue. Officers found Lees with his hands in his pockets and he produced the knife when asked.

On April 2 he walked into Trafalgar House police station and said he had drunk nearly a bottle of lighter fuel and poured some on his hands.

He was arrested under the Mental Health Act and taken to Bradford Royal Infirmary, but he became aggressive and twice spat at a police officer. He then headbutted a picture on a wall, causing the glass to smash.

Mr Donkin said two separate psychiatric reports had been prepared.

Dr Clare Stephenson, a psychiatrist from Lynfield Mount Hospital, said Lees had a long history of aggressive behaviour and services had tried to help him all his adult life.

She said he was a danger to himself and others and he was to be assessed for an independent medium secure unit.

Judge Jonathan Durham Hall QC said he was satisfied restrictions under Section 41 of the Mental Health Act must be put in place.

He adjourned until he received written notification that a bed and transport to the appropriate location were in place.