He then was immediately sentenced to two years of probation and 45 additional days in jail by Judge Richard L. Collins Jr.

Iaconianni could have been sentenced to up to one year in prison, but the judge decided he needed help, not incarceration.

"I would like to be given a chance to right what wrong I've done -- to try to become better and make better decisions," Iaconianni told the judge.

The incident began around 5 p.m. Aug. 16 at Mentor Square Apartments on Center Street when police arrived to investigate a disturbance involving Iaconianni's roommate and a third man.

Iaconianni -- despite having no involvement in that disturbance -- jumped from his second-floor balcony and started to run, prosecuting attorney Karen Kowall said.

A foot pursuit ended when the defendant ducked under the porch of a Mansion Boulevard home.

He then refused commands to come out of the porch, pointed his gun at officers, and had to be doused with pepper spray, police said.

As a precautionary measure, police evacuated nearby homes and apartments as they called for a SWAT team. Police said the suspect did not take any hostages and no one was injured in the incident, which ended about midnight.

"Officers faced with this dangerous situation were able to bring this to a peaceful conclusion. They should be commended," said Kowall, who did not oppose probation.

The judge said Iaconianni has long struggled with substance abuse in addition to his mental health issues. He noted that Iaconianni had only one prior conviction -- for assault -- as an adult.

Defense attorney Sergey Kats said he believes Iaconianni will become a better citizen after his treatment.

As part of his sentence, Iaconianni is forbidden to leave the state without permission. He also must successfully complete a jail substance abuse treatment program, anger management and a mental health assessment.

In addition, he is required to take all prescribed medications, submit to random urine screenings, have only one doctor, dentist, and pharmacist at all times, and go to at least three 12-step meetings a week.

Collins also ordered him to pay all court and supervision costs.

If he fails to comply with any of those conditions, Iaconianni could be ordered to serve his full prison sentence.

Iaconianni, whose bond was revoked after testing positive for marijuana and cocaine, already has served 37 days in jail.