A mentally-ill man who violently assaulted two prostitutes has been detained in a secure hospital.

One victim feared for her life when she was attacked by Martin O’Shea, Bradford Crown Court heard. Judge Jonathan Durham Hall QC said the second woman was subjected to “humiliation, degradation and violence”.

Sentencing him yesterday to a hospital order and a restriction order under the Mental Health Act, Judge Durham Hall said O’Shea would not be released until the level of risk was manageable.

O’Shea, 38, of Whytecote End, Wyke, Bradford, admitted causing actual bodily harm and sexual assault. Prosecutor Dave MacKay said that at 3am on September 20 last year, a 27-year-old prostitute was in the Sunbridge Road area when the defendant jumped out, made a lewd comment and offered to pay for a sex act.

He grabbed her by the throat and head and threw her to the ground.

She tried to get away. Fearing for her life, she hit him on the head with a brick. Police found him lying drunk with a cut head.

Three weeks later a prostitute, 35, who was not working, was walking to her flat when she met the defendant, whom she knew. She agreed to let him use her phone, but when she opened the door of her flat, he “just switched”.

Mr MacKay said O’Shea pushed her to the floor, ripped down her skirt and pulled off her clothing. She kicked him and called for help.

O’Shea pulled her to the kitchen floor and indecently assaulted her, saying: “I need to be with you. I love you.” He also performed another sex act on her.

She hit him over the head with an ornamental hedgehog.

The woman ran out of the flat, wearing only a T-shirt, and hid in the stairwell. Police found her covered in blood, hysterical and still clutching the hedgehog.

Police found 100 pornographic magazines and 30 pornographic DVDs and videos at O’Shea’s home. There was a wall collage of naked and semi-naked women with pictures of cartoon superheroes.

The court heard O’Shea had been given a one-month prison sentence in 2000 for assaulting the partner of a former girlfriend. He was given a hospital order a year later for harassing a woman at a police station by showing her pornographic material. In 2007 he was given two cautions for committing public sex acts in Wyke and Low Moor.

Dr Philip Reed, a psychiatrist caring for O’Shea at a medium secure unit in East Yorkshire, said he had a mental disorder, learning difficulties and an IQ of 55.

He said O’Shea should be detained. He was responding but Dr Reed said he was concerned about his behaviour towards female staff.

Dr Reed said that, and O’Shea’s offending history, led him to ask for a restriction order “for the protection of the public.”

Judge Durham Hall said: “This court will protect all members of this community, whatever their chosen career path.”