An Ottawa judge who created a bogus online dating profile and told a detective that information from the website could have been used to "hang" a female complainant has had his knuckles rapped by Ontario's top court.

In ordering a new trial for a man acquitted of sexual assault, the Ontario Court of Appeal found Superior Court Justice Timothy Ray had violated basic legal principles.

"The conduct of the trial judge while his decision was under reserve as well as his statements to the officer about that conduct were improper and created a reasonable apprehension of bias," the Appeal Court said.

"(This) taints the verdicts of acquittal."

The situation arose in December 2013, when the Ottawa judge retired to consider an appropriate sentence for a man he had just convicted of simple assault — but had acquitted of sexual assault.

Documents show he sent a note to the lead detective, Erin Lehman, saying he wanted to see her in his chambers.

On her arrival, Ray asked if she had gone on Match.com — the dating website on which the complainant and accused had met.

According to court documents, Ray told the officer he had created a fake online profile the previous night before he delivered his verdict, pretending to be a gay man.

"He then told me that if defence had done the same thing, she would have been able to 'hang' the victim with all of the

information available," Lehman said in an affidavit.

Lehman said Ray had asked the bailiff to summon her "discreetly." She also said Ray had suggested they have lunch or grab a coffee one day.

Ottawa judge used 'irrelevant stereotypes,' Ontario's top court rules

Crown lawyer Vikki Bair wrote in an Appeal Court filing she was "shocked" by Lehman's account, calling the incident "very disturbing."

Ray later declared a mistrial on the convictions, admitting to an "error in judgment." However, he insisted he had based his verdicts only on the evidence, and had gone online "out of curiosity," court documents show.

"I was faced with a great number of very personal questions," the judge said. "I then logged out."

Ray also said he was only trying to point out to Lehman that people using the website have to disclose information that could be useful to investigators or defence lawyers.

Either way, the Appeal Court was not impressed.

"He conducted his own research into a website that had been the subject of evidence at trial while his decision was under reserve — contrary to the basic principle that judges and jurors must make their judicial decisions based only on the evidence presented in court on the record," the Appeal Court said.

The court also criticized Ray's views about using website information to "hang" the complainant as well as comments he made in his reasons for judgment. Among other things, he used "irrelevant stereotypes" to judge the complainant, the Appeal Court said in its decision released Friday.

Those comments included his opinion that the complainant did not appear to be an abused or insecure woman.