An Ontario woman says she feels relieved after a judge refused to overturn the sexual assault conviction of a man who claimed after his initial trial that he suffered from sexsomnia.

Ryan Hartman was appealing his sexual assault conviction from 2012. He has not denied sexually assaulting the woman, who is now 30 years old, but claimed in court that he was asleep and had no memory of the incident.

A new trial was ordered in 2015 after Hartman said that he suffered from sexsomnia, a formally recognized sleep disorder in which people engage in sexual behaviours while asleep.

“I know that it strains credibility when you hear about it … but it has been accepted in Canadian cases before,” University of Ottawa law professor Blair Crew told CTV News Channel Monday.

In delivering her ruling on Monday, Justice Kimberly Moore said she rejected the testimony of Dr. Colin Shapiro, the psychiatrist who coined the term “sexsomnia” and said it was likely Hartman had the disorder. Moore said Shapiro seemed to be acting as an advocate for Hartman rather than as an independent witness.

A date for Hartman's sentencing will be decided on Nov. 30.

The victim, whose name is protected by a publication ban, told CTV Ottawa last week that she had fallen asleep on an air mattress with her boyfriend following a party at a home in Brockville, Ont., on the day in question.

“I woke up in pain and realized I was being assaulted,” she said, adding that Hartman was a stranger to her.

On Monday, she said the judge’s decision was “just such a relief.”

“It was worth the fight,” she said. “I’m a stronger person now. I’m a better person. And I’m a role model.”

According to Crew, a precedent for sleepwalking-related disorders as a criminal defence was set in 1992 when the Supreme Court of Canada upheld the acquittal of a man who claimed to have been sleepwalking when he drove to his mother-in-law’s house and killed her with a tire iron.

“Since then, sleepwalking-type defences have shown up about once a year or so in response to sexual assault allegations,” he said.

“The law has long since held that a person doesn’t go to jail unless they were morally blameworthy, and specifically that their actions were conscious and willed at the time.”

The difficulty for people looking to use that defence, Crew said, is that it is “not easily proven and not easily faked.” Judges typically expect experts to testify that an accused suffers from the disorder and was suffering from it at the time they committed their alleged offence.

Sexsomnia itself was successfully used as a defence in 2009 to declare a Toronto man not criminally responsible for sexually assaulting a woman.

With a report from CTV Ottawa’s Joanne Schnurr