A judge has resigned over his conduct of a rape trial in the face of a blistering recommendation for his removal from a national disciplinary body.

Federal Court Justice Robin Camp had asked a complainant in a 2014 rape trial why she did not keep her knees together, and mocked the law of consent. At a hearing conducted last fall by a disciplinary panel established by the Canadian Judicial Council, the 19-year-old homeless complainant said Justice Camp's comment made her hate herself and feel like a slut. After the panel unanimously recommended his removal, Justice Camp went to great lengths to save his job. He publicly apologized to the complainant and his fellow judges.

He called his knees-together comment "unforgivable," and acknowledged that he had perceived the complainant's fragility. He attended in-depth counselling and education sessions with several feminist scholars, three of whom testified at his disciplinary hearing last fall (attended daily by his wife and daughter) that he was sincerely interested in changing.

Story continues below advertisement

Related: Before Justice Camp, these two judges were recommended for removal

Unfounded: Police dismiss 1 in 5 sexual assault claims as baseless, Globe investigation reveals

And he fought for an opportunity to appear in person before the larger body of judicial council members who considered the panel's recommendation, to explain to them that he had acted out of "ignorance, not animus."

The council would receive only written submissions from him.

By a vote of 19 to 4, the judicial council said in its ruling released on Thursday that the deep harm Justice Camp had done to public confidence made his dismissal necessary.

"We find that the Judge's conduct, viewed in its totality and in light of all of its consequences, was so manifestly and profoundly destructive of the concept of impartiality, integrity and independence of the judicial role that public confidence is sufficiently undermined to render the Judge incapable of executing the judicial office," the council said.

All four dissenters, who found Judge Camp guilty of misconduct but opposed his dismissal, are male, and from the Atlantic provinces (one is Chief Justice of the Tax Court of Canada).

Story continues below advertisement

Alice Woolley, the president of the Canadian Association for Legal Ethics and a law professor at the University of Calgary, who, along with three other professors, filed the first complaint against Justice Camp, said she is pleased with the outcome.

"I don't think anything would have been served by carrying this on any further," she said. "The denunciation was unequivocal. I think [resigning] was the admirable decision on his part and the right thing to do."

Constance Backhouse, chair in sexual assault legislation at the University of Ottawa's law school, said rape myths are still pervasive in the justice system and society.

"Our legal system still remains mired in 19th-century stereotypes about women, who are suspected of duplicity, promiscuity, malice, and false testimony," she said. "And our legal thinking reflects the wider culture, which shares far too many of these notions. Until we get over the premise that it is women alone who are responsible for protecting themselves from rape, I suspect we will see more such trials and more protests demanding a woman's right to sexual autonomy."

The law of consent and the judiciary's handling of sexual-assault trials continue to create controversy. In Nova Scotia, a judge acquitted a taxi driver last week of sexually assaulting a female passenger, saying "a drunk can consent." That ruling is under appeal. The woman was so drunk she had urinated on herself and passed out in the back seat.

Recommendations that judges in effect be fired are rare in the Canadian system, which deems judicial independence a cornerstone. Justice Camp is only the third judge whose removal has been recommended since the judicial council was established in 1971. Both of the others also resigned rather than be removed under a provision of the Constitution that requires Parliament to approve dismissing a judge.

Story continues below advertisement

Justice Camp's comments came in the trial of Alexander Wagar in Calgary. The ruling came to light a year later, when the Alberta Court of Appeal overturned it, saying the judge had applied myths and stereotypes about sexual-assault victims. (By then, the Conservative government of Stephen Harper had promoted him from provincial court.) The judicial council received scores of complaints. Alberta Justice Minister Kathleen Ganley asked for the public disciplinary hearing. "On reviewing the transcripts, I felt it was important that victims know this was not an acceptable way to be treated by the justice system," Ms. Ganley said in an e-mail to The Globe after Justice Camp resigned.

Justice Camp, a father of three, received his law degree in 1975 from Stellenbosch University in South Africa, passed exams in Canada in 1998 and was admitted to the Alberta bar in 1999. In 2012, the Progressive Conservative government of Alison Redford appointed him to the Provincial Court. Before then, he practised business law in Calgary.

Federal Justice Minister Jody Wilson-Raybould brought a motion to the House of Commons in which she declared the government's intent to support the recommendation for removal. Shortly afterward, Justice Camp issued a brief statement through his lawyer, Frank Addario of Toronto, expressing his "sincere apology to everyone who was hurt by my comments during the Wagar trial."

With a report from Patrick White