A Nueces County man was found not guilty of aggravated sexual assault after claiming to suffer from “sexsomnia”.

James Baker entered Driscoll Children’s Hospital in Corpus Christi last September with two children and told a doctor he’d sexually assaulted a five-year-old child. In court, Baker’s defense argued that Baker was asleep at the time of the assault, suffering from a condition known as NREM Arousal Parasomnia. The condition is similar to what is popularly known as “sleep walking”, with those affected engaging in lewd acts they later cannot remember because they are technically asleep.

The jury in Baker’s case was deadlocked for hours before deciding that there was not enough evidence to convict him of aggravated sexual assault. He was released form police custody on Friday.

NREM Arousal Parsomnia is an extremely rare condition, but other cases have been reported in the media. In April of this year, a Danish man was acquitted of assaulting two teenaged girls after being positively diagnosed with the condition.