(Reuters) - A Montana prosecutor said on Friday he intended to appeal as too lenient a 31-day sentence for a former teacher who raped a teenage student who later committed suicide.

District Judge G. Todd Baugh has come under harsh criticism since sentencing former Billings high school teacher Stacey Rambold on Monday to 15 years in prison, then suspending all but 31 days of that term, for the 2007 rape of 14-year-old Cherice Moralez.

Before handing down the sentence, Baugh said that Moralez, who committed suicide in 2010, was "probably as much in control of the situation" as Rambold, describing her as a troubled youth who seemed older than her age.

Yellowstone County Attorney Scott Twito said that Baugh, who has since apologized for his remarks, likely erred by misapplying state criminal codes and sentencing recommendations that would have required a minimum of two years in jail.

"I understand the importance of what has happened here, and we are moving as quickly as we can to right a grave injustice," said Twito, whose office had recommended the judge impose a 20-year jail sentence with half of it suspended.

He said he has spent the last week consulting with appellate experts at the state Attorney General's Office about appealing the sentence before the Montana Supreme Court. The state has 20 days to file such a motion once the judgment is signed by Baugh.

"At the end of the day, you have a girl in our community who has been lost. And you have a family who is still suffering," he said.

Rambold had been charged by Yellowstone County prosecutors in 2008 with three counts of sexual intercourse without consent, the Montana equivalent of a rape charge, linked to Moralez, a student in a technology class he taught at Senior High School in Billings.

But Moralez killed herself in 2010 before the case could go to trial, crippling a prosecution case that depended on her testimony.

In an agreement with prosecutors later that year, Rambold admitted to a single count of sexual intercourse without consent and prosecutors agreed to postpone the case for three years and dismiss it entirely if Rambold completed sex offender treatment.

Prosecutors reinstated the case after being notified last year by the treatment center that Rambold, who was suspended in 2008 from his teaching post and later resigned, had been dismissed from the program for violating its rules.

In April, Rambold pleaded guilty to the rape charge stemming from the 2007 assault of Moralez in his Billings home, according to legal documents.