A sex offender who twice attacked a sleeping girl has been locked up indefinitely in a psychiatric unit.

First Natan Stefan Locke-Church, 23, sexually molested the 14-year-old girl as she lay sleeping with others on a pull-out sofa in a friend's house, said Simon Kealey, prosecuting at York Crown Court. She woke, kicked out at him and moved to another room to finish the night.

The next morning she told him to stay away from her.

But two weeks later, at the home of Locke-Church's mother, he again sexually attacked her after she had fallen asleep.

"You know that was terribly wrong," the Recorder of York, Judge Paul Hoffman, told Locke-Church.

"She was perhaps unwise to associate with you under the circumstances, only she did. More particularly on the second occasion, that was inviting trouble. But the responsibility is yours entirely."

After reading reports from two psychiatrists who diagnosed Locke-Church as being a paranoid schizophrenic, he sectioned him under the Mental Health Act indefinitely. He will be held in a Middlesbrough secure unit.

Locke-Church, no fixed address, pleaded guilty to two sexual attacks on the girl. His barrister Nicholas Johnson, said he had a history of mental illness going back to 2002.

The court heard that Locke-Church had previous convictions, including a 30-month jail term passed at Snaresbrook Crown Court in 2000 for aggravated burglary.