NEW YORK — A New York City judge sentenced Occupy Wall Street protester Cecily McMillan on Monday to three months in jail and five years of probation for elbowing a police officer while he was clearing out a protest in Zuccotti Park.

Judge Ronald Zweibel’s decision comes at the end of a trial that sparked widespread anger among Occupy supporters for the circumstances under which McMillan was convicted of second-degree assault. They said McMillan, a graduate student who’s now 25 years old, was simply reacting to an unknown hand grabbing her breast while visiting a March 2012 protest. Officer Grantley Bovell, not McMillan, they said, should have been on trial.

McMillan’s defense attorney, Martin Stolar, has already indicated that he will appeal McMillan’s conviction. McMillan’s supporters have raised about $14,000 for her defense online, and Zweibel’s sentence will likely add further urgency to that effort.

Zweibel could have sentenced McMillan to anything from probation to a maximum of seven years in prison. Ahead of the sentencing, a wide range of supporters called on Zweibel for leniency, from five city council members to the two formerly jailed members of Pussy Riot. Even a majority of the jury — unaware of the maximum seven-year sentence she faced when they convicted her — joined in a letter to the judge seeking leniency in the case.

The Justice for Cecily campaign, a group of supporters, said it delivered over 700 letters to Zweibel ahead of the sentencing, and an online petition calling for her freedom attracted 167,000 signatures.

McMillan’s sentence is believed to resolve one of the last outstanding criminal cases emerging from Occupy Wall Street in New York. Police made more than 2,600 arrests over the course of the protest movement. The NYPD’s tactics were so extreme that critics from law schools said the suppression of protest violated international human rights norms.

Immediately after her May 5 conviction, Zweibel sent McMillan to the jail on Rikers Island. On May 9, she released a statement saying she was “shocked by the jury’s verdict on Monday, but was not surprised by the events that followed. An overreaching prosecutor plus a biased judge logically adds up to my being remanded to Rikers.”

“I was prepared then, as I am now, to stand by my convictions and face the consequences of my actions — namely that of refusing to forsake my values and what I know to be true in exchange for my ‘freedom,'” she wrote.