Prosecutors in Montana are going to the state's highest court in hopes of securing a longer prison term for a former teacher who was given a month-long sentence for raping a 14-year-old girl.

The trial judge tried to impose a new sentence after he came under fire from critics nationwide for the 30-day sentence he gave Stacey Rambold. The Montana Supreme Court, however, ruled that he could not modify the sentence after it had already been imposed.

In the latest twist to the case, state prosecutors are arguing the Supreme Court can impose a new, and tougher, sentence on Rambold.

The student Rambold raped later killed herself.

Rambold was technically sentenced to 15 years behind bars by District Judge G. Todd Baugh in August, but the jurist suspended all but 31 days of the sentence, with a credit for a single day already served. The judge faced national criticism for the length of the sentence and for remarks he made about the girl during the sentencing.

Baugh said that the girl was "older than her chronological age" and "as much in control of the situation as was the defendant." The comments and sentence led to calls for Baugh's removal from the bench.

He scheduled a hearing to try to modify the sentence, but Montana's Supreme Court blocked the attempt and said it would be unlawful.

Attorney General Timothy Fox, in an opening brief filed Friday, argues that Rambold should have at least been subject to the mandatory minimum two-year prison term for his offenses. As a result, he argues, the Supreme Court can vacate Baugh's sentence because it was illegal and impose a new one.

When Baugh suspended all but 31 days of Rambold's prison sentence, "the court imposed an illegal sentence, in which it erroneously attributed culpability to the 14-year-old victim," Friday's brief argues.

In February 2010, after accusing Rambold of having sex with her and while the case was pending, the girl committed suicide. At that time, Rambold acknowledged his actions and both sides of the case agreed to defer prosecution for 36 months.

In a plea agreement, Rambold admitted to having sex with the girl though she was too young to consent, and the state said it would recommend that he receive a sentence of 20 years with 10 of them suspended.

In court, Rambold urged that he was entitled to the most lenient sentence possible for a variety of reasons, including that he had not reoffended, had no prior criminal record and had already lost his teaching career, according to court documents.

The girl's mother said in court that she believed "Rambold's actions were a major factor" in her daughter's suicide.

"She felt guilty for ruining his life," she said at the sentencing hearing, according to court documents. She "has paid the consequences of his actions."

Baugh later apologized for his comments about the victim, saying: "I made some really stupid remarks. It didn't come out right and I owe the whole county, but maybe even the whole country, especially women, an apology."

Rambold finished his 30-day sentence in Montana State Prison in Deer Lodge on Sept. 26, and is on probation.