(CNN) A Canadian federal judge who asked a woman in a rape trial why she couldn't keep her knees together resigned Thursday after a disciplinary council recommended he be removed from the bench.

Judge Robin Camp stepped down before Canada's Parliament could act on the recommendation.

Camp argued that " unconscious bias " was to blame for the offending comments. In addition to asking the 19-year-old why she didn't keep her knees together to fend off her alleged attacker, he also asked her why she didn't "skew her pelvis" to avoid penetration.

Camp apologized and said he was remorseful, claiming it showed he was amenable to rehabilitation.

But the Canadian Judicial Council was not convinced.

"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 in its report

The trial in question

Camp made the comments as a provincial court judge in a 2014 trial. He became a federal judge in 2015.

He also remarked that, "Some sex and pain sometimes go together ... that's not necessarily a bad thing."

Camp acquitted the accused man and offered him some advice:

"I want you to tell your friends, your male friends, that they have to be far more gentle with women. They have to be far more patient. And they have to be very careful. To protect themselves, they have to be very careful."

The comments came to light after the Alberta Court of Appeal overturned the acquittal. The man was found not guilty a second time, which Camp said contributed to his claim that he deserved a second chance.

Judge apologizes, again

Four of the 23 judges on the Canadian Judicial Council voted against the motion to remove Camp. They agreed his behavior rose to misconduct but said a sanction short of removal was appropriate, based on his remorse and efforts to seek rehabilitation.

The council adopted findings from another inquiry that also recommended dismissal . The Inquiry Committee of the Canadian Judicial Council said the judge "relied on discredited myths and stereotypes about women and victim-blaming" and said the comments showed "antipathy" toward laws meant to protect vulnerable witnesses.

The South African-born judge testified in the December hearing that he had "a nonexistent" knowledge of Canadian criminal law and had not received training on sex assault cases. In his legal career, he focused mostly on contract and bankruptcy cases, he said.

In a statement announcing his resignation, Camp apologized "to everyone who was hurt by my comments" during the trial.

"I thank everyone who was generous and kind to me and my family in the last 15 months, particularly my legal team. I will not be answering media inquiries today," he said.