BILLINGS, Mont. (AP) — A former Montana high school teacher sent to prison for 30 days over the rape of one of his students could face more time behind bars after prosecutors appealed the case to the state Supreme Court.

Attorneys for the state and Yellowstone County say a minimum of two years in prison is mandated under state law for former Billings Senior High School teacher Stacey Rambold, 54. They could seek even more prison time for the defendant as the appeal proceeds.

The case garnered widespread attention after District Judge G. Todd Baugh said last week that the 14-year-old victim was “older than her chronological age.”

Baugh’s comments came at a hearing in which he gave Rambold 15 years in prison with all but a month suspended for his months-long sexual relationship with student Cherice Moralez, who committed suicide before the case went to trial.

Moralez’s mother and many others, including Gov. Steve Bullock, condemned Baugh’s remarks, and the judge has since scrambled to undo his actions.

Baugh said two days after the Aug. 26 hearing that his statements about Moralez were inappropriate. And earlier this week, he scheduled a resentencing hearing in the case for Friday.

In that order, the judge agreed with the state’s determination that Rambold’s original sentence conflicted with Montana law.

Prosecutors on Wednesday filed notice that they want the resentencing canceled so the appeal can proceed. Though Baugh’s bid to resentence Rambold is “well-intentioned,” Chief Deputy Yellowstone County Attorney Rod Souza wrote, the judge lacks the authority to take back his original sentence.

In a brief interview, Baugh said he would have no comment on the cancellation request, either publicly or through court filings, until he hears from Rambold’s attorney.

“Right now it’s still on the calendar,” Baugh said of Friday’s hearing. “I’ll be there.”

Rambold last week began serving his monthlong term at the state prison in Deer Lodge. It wasn’t immediately clear if prosecutors would seek to keep him in custody pending the appeal. The case could take between six and 18 months to work its way through the state Supreme Court, attorneys involved said.

Moralez’s mother, Auliea Hanlon, said through her attorney that she welcomed the appeal.

“She’s pleased that the county attorney’s office and attorney general’s office understands that the most significant date to be considered in this sentencing is Cherice’s birthday. She was 14,” said Hanlon’s attorney, Shane Colton.

Rambold’s attorney, Jay Lansing, has not responded to repeated requests for comment on the case. His office said Wednesday he had no plans to do so.

Court documents and transcripts show Lansing sought a short sentence for his client based in part on Rambold’s lack of prior criminal offenses other than a traffic ticket.

Lansing said the former business teacher accepted responsibility for his actions through a 2010 deferred prosecution agreement, in which Rambold admitted his guilt and agreed to seek treatment as a sex offender.

If Rambold had not violated that agreement by getting kicked out of treatment, he would have gotten off with no prison time once his program ended this year.

Prosecutors, who sought 20 years in prison with 10 years suspended for Rambold, have described his actions with Moralez as the “ultimate violation” of her trust in him as a teacher.

Court documents show Rambold and Moralez had three sexual encounters — once each at school, in his car and at his home. The relationship was still going on when authorities were notified in 2008 after Moralez confided in her youth counselor, the records state.

“Law enforcement intervention ended the relationship, not the defendant,” prosecutors said in a presentencing memorandum.

Moralez’s 2010 suicide left prosecutors without their main witness and led them to strike the deal with Rambold that allowed him to avoid prison.

Souza, the county prosecutor, previously argued before Baugh that Rambold “already had his shot” at a more lenient sentence through the deferred prosecution agreement.

“That’s a tremendous break on a case like this, and all he had to do is make the appointments, go through the program, keep his treatment provider informed,” Souza said at the Aug. 26 hearing. “He has miserably failed at that.”

Rambold’s violations of the sex offender program included unauthorized visits with family members’ children and a sexual relationship with a woman that he didn’t report to a counselor. After those events landed Rambold back in court, he was convicted this summer of sexual intercourse without consent.

Whether Baugh’s comments about Moralez will become an issue during the appeal is not yet known.

The judge’s actions in the wake of the original sentencing have done little to sway his critics, including hundreds of protesters who rallied outside the county courthouse last week to call for his resignation. Even Baugh’s belated acknowledgement that the sentence he handed down might be illegal was met with disdain.

“I wish the judge had been thoughtful enough to get it right the first time,” said Eran Thompson with Not in Our Town, a Billings group that promotes diversity and works against hate crimes.

Another activist who helped organize the rally, Sheena Fox, said 45,000 people have signed a petition seeking Baugh’s resignation. She said a formal complaint would be filed against him with the state Judicial Standards Commission.

Baugh, 71, was first elected to the bench in 1984 and has been re-elected every six years since without an opponent. He’s up for re-election in 2014.

He said following the criticism of his remarks that Rambold’s sentence was based on the defendant’s violation of the 2010 deal he made with prosecutors, rather than the original crime. Baugh also said his statements about Moralez were “irrelevant” and did not factor into his sentence.