Defendant Stacey Rambold, 54, last week received 15 years in prison with all but a month suspended for his months-long sexual relationship with Billings Senior High School student Cherice Moralez.
Attorneys for the state and Yellowstone County say a minimum of two years in prison for Rambold is mandated under state law.
"We believe that the sentence Judge Baugh imposed on Stacey Rambold is illegal," Attorney General Tim Fox said in a statement. "Using the means provided by state law, we are appealing his sentence and working diligently to ensure that justice is served."
Baugh has since sought to undo his actions from the Aug. 26 hearing. He said two days later that his comments about Moralez were inappropriate. And earlier this week Baugh scheduled a resentencing hearing for Friday, saying he agreed with the state's determination that his sentence conflicted with Montana law.
But Chief Deputy Yellowstone County Attorney Rod Souza on Wednesday filed notice that it wants the resentencing canceled. Though "well-intentioned," Souza wrote, the judge lacks the authority to take back his original sentence.
Moralez's mother, Auliea Hanlon, said through her attorney that she welcomed the attorney general's involvement in the case.
"Mrs. Hanlon was horribly disappointed with the 30-day sentence and was, frankly, quite shocked," said the attorney, Shane Colton. "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."
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, which attorneys said could take between six and 18 months to work its way through the state Supreme Court.
Rambold's attorney, Jay Lansing, did not respond to calls for comment.
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 Yellowstone County Courthouse last week to call for his resignation.
"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.
Whether Baugh's comments about Moralez will become an issue during the appeal is not yet known.
"It would not be appropriate for us to preliminarily decide what we would or wouldn't do with that aspect of the case," Deputy Attorney General Mark Mattioli said. "At a minimum, the statement of facts in the brief would honestly convey what transpired in the case."
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.
Baugh said in response to the criticism that followed his remarks that Rambold's sentence was based on the defendant's violation of an earlier deal he made with prosecutors, rather than the original crime. Baugh also said his remarks about Moralez were "irrelevant" and did not factor into his sentence.
Moralez's 2010 suicide left prosecutors without their main witness and led them to strike a deal with Rambold that allowed him to avoid prison until he violated the terms of his court-ordered release.
Those violations included unsupervised visits with the children of family members and a sexual relationship with an adult woman that he didn't report to a counselor. They landed Rambold back in court, where he was convicted this summer on one count of sexual intercourse without consent.
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 at school, once in his car and once at his home. The relationship was still going on when authorities were notified in 2008 after Moralez confided in her youth counselor, the court documents state.
"Law enforcement intervention ended the relationship, not the defendant," prosecutors said in an Aug. 23 sentencing memorandum.