A 21-year-old man with a history of sleepwalking has been told he may need treatment after a jury found he was asleep when he sexually assaulted a woman.
Dale Kelly was found not guilty by reason of insanity of sexual assault by penetration after he sleepwalked into the couple's bedroom, got into their bed and touched the woman intimately.
A jury at York Crown Court took just over two hours to reach its verdict.
Kelly, who stood in the dock wearing a navy suit and pale blue tie, hung his head and wept as the jury returned its verdict.
Family members sitting in the public gallery gasped and comforted each other.
The week-long trial heard that Kelly had been to a nightclub with a man and the woman before they returned to the house in a taxi on the morning of April 17 2017.
Kelly fell asleep in the taxi and went straight to bed when they arrived at the house but, around an hour later, the woman awoke to find him in the bed.
She said she believed Kelly had sexually assaulted her and called the police.
Kelly said he was dreaming at the time and thought he was with a woman he was dating.
He left the house after the incident and sent a message to his friend a short time later, which read: "I promise right now I have no ******* clue what's going on, I'm still wanting to wake up and for this to be in dreamland."
After his arrest, Kelly underwent tests, during which he experienced episodes of the sleep disorder parasomnia, which can include sleepwalking.
The court heard that he had suffered from parasomnia since childhood and experts said he was "possibly" or "likely to be" suffering from the disorder at the time of the alleged assault but they could not say for certain.
Eleanor Fry, defending, said the defendant could not say what happened that morning as he was asleep at the time.
Judge Simon Hickey described it as an "unusual" case and said sentencing options were limited to a hospital order, a supervision order or an absolute discharge.
He said: "This has not been an easy case and not a straightforward case, it is an unusual case."
The judge adjourned sentencing until a later date when he said experts will address the issues in the case.
He said that doctors in the case believed Kelly's "mental disorder" was treatable and needs treating.
He said: "My sentencing options are limited.
"At the moment I'm leaning towards a hospital order but I will wait to hear what the experts say."
Kelly, from Dalton-le-Dale, County Durham, was granted conditional bail and will be sentenced on September 23.