A MAN was cleared of rape yesterday - after a jury accepted he had been sleepwalking.

James Bilton, 22, said he could not remember the alleged attack at his flat in York and that he must have been sleepwalking.

The bar worker of Hope Street, York, told police he had walked in his sleep since the age of 13.

He was cleared of three counts of rape by a jury at York Crown Court following a week-long trial and slumped forward in the dock as the verdicts were read.

The jury of seven women and five men took two-and-a-half hours to clear Mr Bilton on all three counts. He had denied the charges.

He left the court in tears supported by friends and family and declined to comment.

During the trial the jury was told that the victim knew Mr Bilton and after a night out with her in March this year, Mr Bilton put her to bed in his flat while he slept on the sofa.

Later, the 22-year-old victim claimed she woke to find her trousers had been taken off and Mr Bilton assaulting her.

The woman denied she consented to sex.

Mr Bilton said he had no knowledge of the attack but he had a history of sleepwalking which ran in the family.

He could only remember waking up after sticking to the leather sofa and was ''completely oblivious'' to what had allegedly happened, the court heard.

Sleep expert Dr Ishaad Ebrahim said Mr Bilton did suffer from the condition and revealed that people who are sleepwalking can carry out actions which they do when awake.

The court was told between one and 2.5 per cent of the adult population suffer from the condition. Of those four per cent carry out sexual behaviour.

Although the defence of sleepwalking is extremely rare, yesterday's case followed a similar acquittal in Canada.

Last month, Jan Luedecke, 33, was acquitted of raping a woman after a judge ruled that he was asleep during the attack.

Mr Luedecke and his alleged victim had both attended a party in 2003 when the woman fell asleep on the couch and when she awoke, she says she found him having sex with her.

He was charged with sexual assault but at the trial sleep experts and psychiatrists testified he suffered from ''sexsomnia''.

The court in Toronto heard that sexsomnia is when a person has sex while they are still asleep.

The case caused outrage among women's groups in Canada when the judge decided that the defendants conduct was ''not voluntary''.

In 1996, a Canadian man was acquitted of killing his wife after it was determined he had been sleepwalking.