Alberta Federal Court Justice Robin Camp's decision came after a scathing Canadian Judicial Council review called for his removal.
The review concluded he acted in a manner that seriously undermined public confidence in the judiciary.
The federal justice minister has accepted his resignation.
Mr Camp's comments made during a 2014 rape trial sparked outrage and drew sharp criticism from sexual assault victims and their advocates.