BRAMPTON, Ont. -- A Toronto police officer convicted of assaulting a protester during the G20 summit was sentenced Monday to 45 days behind bars, though he was almost immediately granted bail pending an appeal.

Const. Babak Andalib-Goortani, 33, was convicted in September of assault with a weapon for using excessive force during the arrest of protester Adam Nobody on June 26, 2010, on the lawn of the Ontario legislature.

His lawyer, Harry Black, urged the judge to give the officer an absolute discharge, saying his client has suffered enough with depression, anxiety and the break-up of his marriage after he was charged. Andalib-Goortani's "fragile" mental state has only worsened since his conviction, Black said.

But Ontario Court Judge Louise Botham said that a discharge would be "contrary to the public interest," nor would a sentence served in the community be adequate.

"Citizens will respect the rule of law when they can be confident that those with the power to enforce our laws do so fairly," Botham said as Andalib-Goortani held his head in his hands. "When that trust is abused citizens need to know that police will be held accountable."

Botham was brought in from outside Toronto specially to hear the case and the sentencing took place Monday in Brampton, Ont., where she normally sits. About 10 minutes after Botham read her sentence another lawyer was in a courtroom in Toronto securing bail for Andalib-Goortani pending an appeal.

Andalib-Goortani was granted $7,500 bail and as one of the conditions he must get another job if he is suspended without pay from the force.

Under the Police Services Act a suspended police officer in Ontario must be paid until they are sentenced to a term of imprisonment. Once that happens a police chief "may" suspend an officer without pay even while an appeal is in the works. Mark Pugash, the director of corporate communications for the Toronto Police, said Andalib-Goortani is now being suspended without pay.

Once the appeal process concludes, Andalib-Goortani will go through the internal police discipline process, which could see him lose his job with the police service entirely. Black suggested during his sentencing arguments that a jail term made it more likely Andalib-Goortani will eventually be fired.

"It seems inhuman to take the position now that he should be out of a job, take away his career, put him in jail or give him a conditional sentence," Black said. "It's hard to imagine what motivates the Crown to say, 'He should suffer some more. He should be penalized some more. He has not been hurt enough by this process."'

Andalib-Goortani hit Nobody several times with his baton while he was already on the ground, surrounded by other officers in the process of arresting him, Botham said. He was offering minimal resistance and several other police officers were piled on top of him, she found.

The officer has shown no remorse for his actions, the judge said.

"Three years after the event he continues to justify his actions by saying Adam Nobody was resisting arrest," Botham said.

She also noted Andalib-Goortani's name tag and badge weren't visible.

"I can only conclude this was a deliberate act on the defendant's part to make it harder for people to identify him."

Nobody said after the sentence was handed down that he was glad the judge gave Andalib-Goortani jail time, but the G20 incident had shaken his trust in the police.

"Your whole life you're brought up to believe cops were the good guys. Sometimes that gets shattered," he said outside court. "And once that's shattered who do you trust? If I'm being burglarized who am I going to call?"

More than 1,000 people were detained by police that weekend after protesters using so-called Black Bloc tactics broke away from a peaceful rally and ran through the downtown, smashing windows and burning police cruisers.

The vast majority of those detained were released without charge within 24 hours.

Andalib-Goortani was one of two officers to face criminal charges stemming from the arrests, but earlier this year Const. Glenn Weddell was acquitted. Andalib-Goortani still faces another charge of assault with a weapon stemming from the G20. That case is slated for trial in February.