A Brockville, Ont., judge has rejected a man's sexsomnia defence and ruled he is criminally responsible for the sexual assault of a woman in 2011.

Ryan Hartman, 38, was found guilty of sexual assault in 2012 and sentenced to 14 months in jail. He appealed and lost.

When he appealed again, he admitted to the crime but presented evidence that he was suffering from sexsomnia — engaging in sexual acts while asleep — and argued that he was sleeping when he raped the woman.

The Ontario Court of Appeal granted him a new trial, which began in April 2017.

In her ruling Monday, Justice Kimberly Moore said Hartman had failed to prove he was suffering from a sleep disorder that would make him not criminally responsible for the assault.

She said it was far more likely an alcoholic blackout would explain his claimed lack of memory of the event.

She also did not rely on the testimony of Dr. Colin Shapiro, a sleep expert, who said Hartman experienced "sexsomniac episodes," saying there were problems with his report.

"I find that Dr. Shapiro's evidence displayed bias and an unwillingness to accept any evidence that contradicted his opinion that Mr. Hartman was suffering from a parasomnia at the time of the incident," the judge said in her decision.

She said it was troubling that Shapiro did not question Hartman's version of events and did not reconcile the testimony that Hartman woke up in the middle of the night prior to the assault.

The judge said Shapiro had previously testified that being awake meant it would require more time to get into the deep sleep state that is a precondition of a sexsomniac episode.

The judge also said Shapiro as a witness was prone to tangents targeting another psychologist that were "unsolicited, gratuitous and non-responsive to the questions asked of him" and demonstrated a "lack of professionalism."

Justice Kimberly Moore found that the expert in the sexsomnia case did not provide a clear report and acted sometimes as an advocate rather than a witness. (Matthew Kupfer/CBC)

The judge accepted that Hartman had suffered from parasomnia — that he sleepwalked as a child — and that a video from Shapiro's sleep assessment showed Hartman "touched his genital area for approximately four seconds" while asleep.

She said that may well have been sexsomnia but it was "nothing like" the account from Hartman's fiancée that he masturbated while asleep at one point in their relationship.

In the decision, the judge said she found that Hartman went limp and pretended to be asleep once the victim woke up and pushed him away.

She said that Hartman's apology to the victim's boyfriend that he woke up and was making out with her was an attempt to suggest "an element of consent."

She also rejected that he had been asleep during the act and woke up to the commotion and accusations of the woman.

"I find it incredible that if one was accused of such a horrific act, and one was truly sleeping and had no recall of same, one would not ask for answers and an explanation in order to understand what had happened." the judge said

'Finally some justice'

Since being raped in 2011, the 30-year-old Ottawa-area woman, whose identity is protected by a court order, has gone through two trials and two appeals.

She says the delay has plunged her into depression and anxiety, and she's battled alcohol and drug abuse, endured toxic relationships and wrestled with suicidal thoughts.

A judge in Brockville, Ont. rejected the man's claim that he suffers from 'sexsomnia,' finding him criminally responsible for a 2011 sexual assault. 0:21

She said she feels shocked and relieved after hearing the judge pronounce the guilty verdict.

"Finally some justice," she said.

"You can't express how you feel when you hear that as a victim. It's not explainable, it's amazing, it's incredible, I'm shaking. I'm crying."

The woman said she hoped that other women feel "hope" in the wake of the conviction.

House party

The assault happened in 2011 at a house party the woman attended with her boyfriend in Spencerville, Ont.

The couple slept there, on an air mattress, after deciding they had had too much to drink.

Just a few minutes before her cellphone alarm went off that morning, she felt pain and realized she was being penetrated anally. Her boyfriend remained asleep.

Court heard that Hartman apologized to her boyfriend afterward and said he woke up "making out" with the woman.

As the couple drove away from the home, she saw Hartman sitting at a picnic table in the garage looking "wide awake."

Sexsomnia as a defence

Deep sleep as a criminal defence has only been used 13 times in Canada in sexual assault cases, said Blair Crew, a University of Ottawa professor who teaches sexual assault law.

He said that since a precedent-setting case in Toronto in 2003, sexsomnia has resulted in a ruling of not criminally responsible five times.

Where to get help:

Assaulted Women's Helpline: 1-866-863-0511

Support Services for Male Survivors of Sexual Abuse: 1-866-887-0015