Courtesy NBC News

By Elizabeth Chuck, Staff Writer, NBC News

A 30-day sentence for a high school teacher in Montana who had sex with a 14-year-old student has sparked protests and calls for the judge to resign, and now, prosecutors in the case are vowing to appeal.

"Certainly I'm disappointed in this sentence, but I have a job to do, and my job right now is to figure out if this case can be appealed because of some legal error," Scott Twito, the county attorney in Yellowstone county, Mont., said, NBC's John Yang reported Tuesday on TODAY.

The decision to appeal is the latest development in the case, which attracted about 400 protesters to the county courthouse in Billings, Mont., last Thursday, calling for the resignation of state District Judge G. Todd Baugh.

Marching with signs that read "14 IS 14!", the protesters endorsed Baugh's description of himself as a "blithering idiot" for having said in court last week that the victim was "older than her chronological age" and was as much in control of the situation" as the teacher who assaulted her. The girl committed suicide after the assault came to light.

More than 45,000 people have signed an online petition demanding that Baugh, 71, resign, arguing that Baugh has "engaged in the worst kind of victim shaming."

"We will no longer stand by while individuals speak about victims in this way," Kate Olp, the petition organizer, said.

Baugh apologized last Wednesday for the words he used, but defended the 30-day sentence he handed down to Stacey Dean Rambold, 54.

"What I said was demeaning to all women, not what I believe in and irrelevant to the sentencing," he said, adding that he did not intend to resign from his elected post.

The victim's mother told TODAY that the judge's sentence and language has left her "horrified."

"I don't believe in justice anymore. It was a joke," she said.

Rambold, a technology teacher, was originally charged with three felony counts of sexual intercourse without consent in 2008 when officials at Billings Senior High School first became aware of the sexual relationship.

The girl committed suicide in February 2010, denying prosecutors of their lead witness. Prosecutors agreed at the time to defer prosecution for three years and dismiss the charges if Rambold completed a sex-offender treatment program.

But Rambold was kicked out of the treatment program for violations, including missed meetings and having unsupervised visits with his nieces and nephews, who are minors. In April, he pleaded guilty to a single felony count.

At his sentencing hearing last Monday, prosecutors asked the judge to put Rambold behind bars for 20 years, but Baugh said he didn't think the violations were serious enough to merit such a long prison term.

After Rambold's 30 days in jail, he will be on probation for 15 years. He then must register as a sex offender.

NBC's M. Alex Johnson contributed to this report.

Read on NBC News