A woman whose assault case had become a cause célèbre, first among Occupy Wall Street supporters and then expanding well beyond the movement, was sentenced to three months in jail on Monday, as a judge rejected calls for her immediate release.

The woman, Cecily McMillan, 25, a graduate student at the New School and a volunteer labor organizer, was convicted two weeks ago of assaulting a police officer at Zuccotti Park in Manhattan in 2012.

Before the sentence was delivered, Ms. McMillan remained mostly defiant, even as she characterized the encounter with the officer as “an accident.”

“I cannot confess to a crime I did not commit,” she said in State Supreme Court in Manhattan.

But Justice Ronald A. Zweibel, who had remanded Ms. McMillan on May 5 after the four-week trial, imposed the jail sentence that prosecutors had requested, rather than release her on probation, as her lawyers had urged. She could have faced a maximum of seven years for the second-degree assault.