A Canadian judge, who shamed a sexual assault complainant by asking her why she could not "keep your knees together" during the trial, has resigned.

Alberta Federal Court Justice Robin Camp's resignation was accepted by Federal Justice Minister Jody Wilson-Raybould on Thursday (9 March). While accepting Camp's decision to step down the justice minister said that she was confident Camp received due process in his disciplinary review and acknowledged his decision of resignation as of 10 March, the BBC reported.

"Sexual assault and gender-based violence is in no form acceptable and we will continue to stand up for victims," Wilson-Raybould added.

The resignation of the judge came after he faced a series of backlash from Canadian Judicial Council review, which called for his removal from the post. Camp is accused of misconduct during a 2014 rape trial.

According to reports, in the 2014 case, he had asked a 19-year-old woman: "Why couldn't you just keep your knees together?" He also said "pain and sex sometimes go together" and had referred to the complainant as "the accused," court records showed.

The Council found that Camp had relied on "discredited myths and stereotypes about women and victim-blaming" during the trial and in his reasons for judgement, thus calling for his elimination.

It added that Camp's behaviour during the trial were "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".

Meanwhile, a new trial for the accused Alexander Wager, who according to the woman had raped her over a bathroom sink at a house party in Calgary, has been ordered.