A judge who asked a complainant in a rape trial why she couldn’t just keep her knees together has resigned, hours after the disciplinary body for Canadian judges recommended that he be removed from the bench.

In a brief statement on Thursday, federal court justice Robin Camp submitted his resignation over his behaviour while presiding over a 2014 trial into allegations of sexual assault. “I would like to express my sincere apology to everyone who was hurt by my comments,” he added.

The Calgary trial made headlines around the world after it emerged that Camp had repeatedly asked the 19-year-old complainant why she had not done more to prevent the alleged rape. “Why couldn’t you just keep your knees together?” Camp asked her. Later he told her that “sex and pain sometimes go together”.

Camp’s resignation came shortly after after the Canadian Judicial Council announced it had wrapped up its 15-month review into the judge’s conduct. The judicial watchdog concluded that Camp had relied on discredited myths, stereotypes about women and victim-blaming during the trial and noted in its report that Camp had at times addressed the complainant – a young indigenous woman who was homeless at the time of the alleged assault – in a manner that was “condescending, humiliating and disrespectful”.

Throughout the trial, Camp repeatedly referred to the complainant as “the accused”. After she told the court that the alleged assault took place in a bathroom sink, Camp asked her why she hadn’t sunk her “bottom down into the basin so he couldn’t penetrate you”.

Camp went on to acquit the man accused in the case. The Alberta court of appeal later ordered a new trial in which the 29-year-old accused was subsequently acquitted.

In September, an inquiry began looking into whether Camp – a provincial judge who had been recently promoted to the federal court – should be removed from the bench.

The inquiry heard a remorseful Camp apologise for his remarks. “I was not the good judge I thought I was,” said the 64-year-old. Camp, who was born in South Africa and moved to Calgary in 1998, said he had not understood the changes made to Canadian laws aimed at sheltering sexual assault complainants from discriminatory attitudes.

He went to great lengths to demonstrate to the panel that he should keep his job, citing a series of one-on-one counselling and education sessions he had undertaken with feminist scholars to educate himself on sensitivity and sexual assault laws.