Dharun Ravi was sentenced Monday to spend a month in county jail, but the former Rutgers University student convicted of spying on his gay roommate via a remote webcam won’t know his fate for another nine days. That’s how long the Middlesex County Prosecutor’s Office has to appeal the judge’s surprising sentence in a case that has captured national attention and sparked a debate on cyber bullying and gay teen suicide.

For now at least, Ravi remains free.

Superior Court Judge Glenn Berman shocked the New Brunswick courtroom Monday when he ordered Ravi to spend 30 days in jail, departing from established sentencing guidelines that called for up to 10 years in state prison. Visibly upset with the sentence, First Assistant Prosecutor Julia McClure immediately told the judge she would appeal.

Berman’s decision means there will be even more drama before the long legal battle is over in a case that has already stretched 20 months.

Ravi’s defense team has indicated it will appeal the March 16 conviction, in which the 20-year-old was found guilty of bias intimidation, invasion of privacy and related charges.

The prosecutor’s office must file its appeal before May 31, when Ravi is ordered to begin his month-long sentence in Middlesex County jail. Ravi would remain free pending the appeal.

In assessing Monday’s sentence, legal experts say the prosecutor’s office has a case now that the judge gave Ravi jail time on lesser charges of hindering apprehension and tampering with witnesses. Both charges carry a presumption of no jail time. Meanwhile, the three bias counts, which the judge gave Ravi probation for, do carry a presumption of prison time.

Rutgers Law School professor Louis Raveson said because the bias counts are second-degree crimes, Ravi ordinarily would have been sentenced to prison. The only way around it, Raveson said, is "if doing so in this case would constitute a serious injustice. It’s a hard standard to meet," he added. If it wasn’t an injustice on the lesser charges, Raveson said, how could it be an injustice on bias?

But in explaining his decision, Berman said he was convinced "the mitigating factors outweigh the aggravating factors" when it comes to the bias counts. As he had at trial, Berman reiterated his problems with the state’s existing bias statute. Referring to the bias law as it relates to Ravi’s actions, Berman said, "the legislature was not envisioning this behavior, regardless of how reprehensible." Of the 39 states that have bias statutes, Berman found that most were for violent behavior. "That’s what I believe the Legislature had in mind when they adopted this statute."

But Leslie Sinemus, immediate past president of the Association of Criminal Defense Lawyers of New Jersey, said the prosecutor’s office could have a good shot at overturning the sentence because the second-degree bias convictions do carry a presumption of incarceration, even for a first-time offender like Ravi. "I’m not sure 30-day sentence as condition of probation sends the defendant or future defendants the message," she said.

In addition to 30 days jail, the judge sentenced Ravi to three years probation and told him to contribute $10,000 to a state licensed community based organization dedicated to assisting victims of bias crimes. Berman also said he would recommend Ravi, who has lived in this country most of his life but is not a citizen, not be deported to his native India. Assistant Prosecutor McClure did not comment on the sentencing, but in a statement to reporters, Prosecutor Bruce Kaplan said he would appeal. He called the judge’s decision "insufficient under the sentencing laws of this state, the facts that were determined by a jury and long-standing appellate precedent."

Gay activist responds to the Dharun Ravi sentenceBill Dobbs, a gay activist from Manhattan, responds to the sentencing of Dharun Ravi at Middlesex County Court House in New Brunswick. Dobbs felt that this case triggered public outrage nationally because of a tabloid flavor that gave many people the idea that Ravi caused Tyler Clementi's death. According to Dobbs, the outrage may have pushed the justice system a bit off track, creating too many charges and potential punishment. Ravi was sentenced to a 30-day term in the county jail for intimidation and invading the privacy of his roommate, who later committed suicide. The 20-year-old former Rutgers University freshman was facing as much as 10 years in state prison. (Video by Andre Malok / The Star-Ledger)

While noting that the prosecution does have a case, Fordham Law School professor Annemarie McAvoy said "the appeal will be hard. Unless there are mandatory guidelines, it’s hard to force a judge to sentence someone to jail time. The judge listened to all sides. He had a reasoned view."

Berman called Ravi’s actions "cold, calculated and methodically conceived" but said they stopped short of hate. Berman also showed his hand by placing more emphasis on the witness tampering and hindering apprehension than on the bias. "The jury essentially convicted you of lying," he told Ravi to a hushed courtroom. The sentencing was broadcast live and included two overflow courtrooms for onlookers and journalists.

One law professor commended Berman on the sentence.

Mark Poirier of Seton Hall University said he was "very impressed" with the judge’s decision and says it won’t be overturned on appeal.

"I’m not sure these facts support bias," Poirier said. "Berman did his homework."