BILLINGS, Mont. (AP) — A Montana judge lacks the authority to impose a new sentence on a man sent to prison for a month for raping a 14-year-old girl, who later committed suicide, the state's high court has ruled.

Friday's decision came as the judge sought to change the former teacher's sentence after his original ruling, in which he said the student was "older than her chronological age," drew widespread criticism.

An appeal of the case already was pending from prosecutors who contend that former Billings teacher Stacey Rambold, 54, should serve two years, at a minimum. But Judge G. Todd Baugh sought to undo the 30-day sentence on his own after his remarks triggered a public backlash and calls for his resignation.

Rambold's victim, Cherice Moralez, committed suicide in 2010 while the case was pending. Baugh commented at Rambold's Aug. 26 sentencing that she was "as much in control of the situation as was the defendant."

The state Supreme Court intervention came in response to an emergency petition from the Attorney General's Office to stop Baugh's plans for a Friday afternoon resentencing. The state had warned that Baugh's plans could throw the case into disarray and "cause gross injustice to an orderly appeal."

Less than an hour before the hearing was to begin, the high court ordered Baugh to cancel it and enter a written sentence for Rambold so the appeal process could proceed.

Court records show Baugh submitted two signed judgments on Friday: One calling for a two-year prison term for Rambold — with a note at the bottom saying it was withdrawn given the Supreme Court order — and a second that matched his original oral pronouncement for a 30 day term.

Appearing in his courtroom about the time the hearing was scheduled to begin, Baugh told a group of reporters that he stuck with his original, oral judgment in order to comply with the court order.

The judge also seemed to affix some degree of blame for the original sentence on prosecutors, because they did not immediately raise objections to his actions at the Aug. 26 hearing.

Story continues

Yellowstone County Attorney Scott Twito said in response that his office had sought 20 years in prison for Rambold with 10 years suspended, and it was up to the judge to make a final determination that day.

Rambold will continue to serve out the original sentence while the appeal is pending, Twito said. That means he will be released from prison late next month but remain under probation and have to register as a sex offender.

Activists who pushed for Baugh to resign or be removed from the bench said Friday those efforts would continue.

"He took no responsibility, no ownership. He blamed the state, blamed the prosecutor," said Marian Bradley, president of the Montana National Organization for Women. She said his earlier comments "tell women it's not OK to step forward, because even if you do, you could be knocked down by a judge."

Moralez's mother, Auliea Hanlon, said through her attorney that she was pleased the appeal can now move forward.

Baugh told The Associated Press he had "tried to do the right thing."

"I've said what I can say. Those people that disagree with it are always going to disagree with it," he said.

University of Montana School of Law professor Jeffrey Renz said the state had law on its side in arguing Baugh's attempt to unilaterally change Rambold's sentence violated proper procedures. But as a practical matter, Rambold likely will return to Baugh's courtroom one way or another, since the state Supreme Court would remand the case back to the judge to fix any sentencing problems, Renz said.

The sentence handed down Aug. 26 had been suggested by Rambold's attorney, Jay Lansing.

Lansing said in a court brief filed this week that a new sentence from Baugh would have created "confusion and uncertainty for all parties." He said the original sentence — 15 years with all but 31 days suspended and a one-day credit for time served — was allowed under state law.

Prosecutors didn't challenge the 30-day sentence as illegal until the days after the Aug. 26 hearing, when they discovered the mandatory minimum term for sexual intercourse without consent was two years.

Baugh on Friday repeated his assertion that giving Rambold the minimum mandatory sentence was appropriate due to the circumstances of the case. He described the former teacher with no prior record as a low risk to re-offend after spending more than two years in a sex-offender treatment program.

The defendant entered that program in 2010, after Moralez's suicide left prosecutors without their main witness in the case shortly before it was scheduled to go to trial.

That led to a deferred prosecution deal that allowed Rambold to avoid trial until he violated the terms of the agreement last year, for not reporting that he was in a sexual relationship with a woman and for unauthorized visits with family members' children.

Court documents show there were complaints about Rambold's conduct with female students as early as 2004. Three years before his relationship with Moralez, prosecutors say, "he was warned to stay away from young girls in his class."

No charges were filed, and Lansing has said his client would challenge those accusations.