A former high school teacher was released Thursday from prison after serving just 31 days for raping a student who killed herself before the case went to trial.

Stacey Rambold will be placed on probation for 14 years and 11 months for the rape of former student Cherice Moralez, who was 14 years old at the time.

She took her own life just before her 17th birthday, and her mother blamed the sexual assault for her death.

Judge G. Todd Baugh attempted to void the sentence he handed down after the short term drew quick and widespread condemnation, but the Montana Supreme Court blocked him from doing so.

The 71-year-old Baugh said his sentence was "illegal" because it ignored the compulsory minimum sentence of two years in jail.

The judge was harshly criticized for comments he made about the victim, saying the girl “seemed older than her chronological age" and she was "as much in control of the situation.”

Two chapters of the National Organization for Women and an activist group called Ultraviolet filed formal complaints Tuesday with a judicial review board.

More than 140,000 people have signed accompanying petitions, the groups said.

[Prison.Jail by Shutterstock]