Crown prosecutors were at the Ontario Court of Appeal on Thursday, trying to designate sexsomnia as a mental illness after a man was cleared of sexual assault due to the rare sleep aberration.

The designation would allow courts to impose conditions on offenders such as Jan Luedecke, who claimed to be in a dissociative sleepwalking state when he sexually assaulted a woman after a party in 2003.

Crown prosecutor Kimberley Crosbie on Thursday sought to have Luedecke deemed mentally ill and forced to appear before the Ontario Review Board, which reviews cases where an offender is found not criminally responsible because of mental disorder.

The three judges hearing the case reserved decision. If Luedecke appeared before the board, it could choose to send him to hospital, back into the community with conditions, or discharge him altogether.  

"I think that's the overarching concern here, the protection of the public," said Crosbie. "What we're concerned about is that nothing like this happens again."

Luedecke alleges that during a party at a Toronto home in 2003, he got drunk and fell asleep on a couch.

His lawyers maintained that while Luedecke was in a dissociative sleepwalking state, he went over to a woman who was sleeping on an adjacent couch, lifted up her skirt, put on a condom and began sexual intercourse with her.

She woke up and asked what he was doing, and who he was. He told her his name and got up.

The woman ran to the washroom, after which she came back and saw Luedecke standing in the middle of the room. She left to seek medical attention and the authorities were called.

During the trial, his defence called Toronto psychiatry professor Colin Shapiro, an expert on the condition known as sexsomnia. Shapiro testified that Luedecke was in a dissociative state when the incident occurred and didn't realize what he was doing.

Shapiro said that it is possible to engage in complex abnormal behaviours during that state.

The Crown never presented expert evidence to counter the argument and Judge Russell Otter found that Luedecke was in a sleepwalking state at the time.

The issue then became whether the condition was caused by a mental disorder or something else.

If it was a mental condition, Luedecke would have been subject to a number of conditions, including medication or indeterminate detention.

But Otter relied on the evidence of Shapiro, who said sleepwalking does not arise from a mental illness, and Luedecke was released.

"The public should understand that these cases, though rare, are documented in the medical literature," Frank Addario, Luedecke's lawyer, said outside the court Thursday.

"The finding at trial, which is not challenged on appeal, was that it wasn't volitional, it wasn't a deliberate choice that he made, that it was something that was done while he was unconscious."

Crosbie has asked the appeal court to enter a new conviction or order a new trial, which is unlikely barring a significant error in the law.   

Addario suggested instead that the appeal court must decide whether the trial judge erred while deciding whether Luedecke was affected by a sleep or a mental disorder.

"If it's just a sleep disorder and it's unlikely to re-occur, then it's not a mental disorder and he doesn't need hospitalization and the state won't be able to follow him around."

Sanjeev Anand of the faculty of law at the University of Alberta told CBC News that the case could be important because it will shine light on Shapiro's contention that sexsomnia is not a mental condition.

Anand said if a new trial is ordered, Crown prosecutors could present evidence from psychiatrists who disagree with Shapiro.

"What could happen as a result of this overall case is that it ends up being a wakeup call to Crown prosecutors that the psychiatric evidence presented by Dr. Shapiro may not in fact be the orthodox view of psychiatry."

With files from the Canadian Press