A Canadian federal judge who asked an alleged rape victim in court why she couldn’t “just keep your knees together” resigned Thursday, after a judicial panel released a scathing report calling for him to be removed from office.

Justice Robin Camp of the Alberta Federal Court came under fire in 2014 for badgering the woman during trial about whether she could have done more to defend herself against the man she claimed had attacked her. The Canadian Judicial Council conducted a 15-month review of the exchange after receiving dozens of complaints from the public.

In its report Thursday, the council found that Camp’s conduct was “manifestly and profoundly destructive of the concept of impartiality, integrity and independence.”

“Public confidence is sufficiently undermined to render the judge incapable of executing the judicial office,” the council wrote. “The judge’s removal is warranted.”

Within hours, Camp, 64, said he would step down. He apologized in a statement to “everyone who was hurt” by his comments. Federal Justice Minister Jody Wilson-Raybould accepted his resignation, saying she was confident he had received due process, according to the BBC.

“Sexual assault and gender-based violence is in no form acceptable and we will continue to stand up for victims,” she said.

Camp presided over the sexual assault trial of Alexander Wagar, a 29-year-old Calgary man. The accuser was identified as a 19-year-old woman who said Wagar had raped her over a bathroom sink during a house party, as The Washington Post has reported.

Throughout the trial, Camp falsely referred to the woman as “the accused” and suggested she could have staved off the alleged attack.

“Why couldn’t you just keep your knees together?” Camp asked at one point.

He later said that young women “want to have sex, particularly if they’re drunk,” and told the accuser that “some sex and pain sometimes go together” and “that’s not necessarily a bad thing.”

Camp also questioned why the woman didn’t “just sink your bottom down into the basin so he couldn’t penetrate you,” saying that she could have avoided the attack if she had turned her pelvis “slightly” away.

Camp acquitted Wagar in September 2014, but an appeals court overturned the ruling. In January 2017, Wagar was acquitted again in his retrial, with a new judge finding that there was reasonable doubt that he had sexually assaulted the woman.

The Canadian Judicial Council opened an investigation in November 2015, after a group of law professors filed complaints against Camp. Dozens of other complaints from members of the public, and Camp went on to recuse himself from cases involving sex crimes, as The Post’s Kristine Phillips has reported.

Wagar’s accuser said she felt so browbeaten by Camp that she considered suicide.

“What did he get from asking that,” she said. “He made me hate myself and he made me feel like I should have done something, like I was some kind of a slut.”

During the council’s investigation, Camp said he didn’t realize his comments were problematic until his verdict was appealed, according to Canadian Broadcasting Corp. He said his words came from a “deep-rooted” bias “that all women behave in the same way and should resist.”

Camp grew up in South Africa and received commerce and law degrees from the University of Stellenbosch, according to judicial records. After practicing as a barrister there, he moved his wife and three children to Calgary in 1998, focusing mostly on contract, trust and bankruptcy litigation. The council noted that he had almost no experience in Canadian criminal law.

At a hearing, Camp’s daughter testified that she herself is a rape victim. She called her father’s comments “disgraceful,” but said she stood by him, describing how he supported her when she told him she had been raped in her home, the CBC reported at the time.

“I have seen him advance in understanding and empathy for victims, vulnerable litigants and those who have experienced trauma,” Camp’s daughter wrote.

Camp later admitted to misconduct but argued that he should be able to keep his job. His words, he told the panel in written submissions, were the product of “unconscious bias or ignorance,” not hostility toward the accuser. He said he had spent months educating himself on Canada’s sexual assault laws, speaking with feminist scholars and seeking sensitivity training.

The council was unconvinced.

“He spoke in a manner that was at times condescending, humiliating and disrespectful,” the report read.

“Having regard to the totality of the Judge’s conduct and all of its consequences,” the council wrote, “his apologies and efforts at remediation do not adequately repair the damage caused to public confidence.”

More from Morning Mix: