A 32-year-old homeless man was found guilty of murder and firearms charges Friday in a River North shooting that left an off-duty Chicago police officer dead and another man badly wounded.

Seated alone at the defense table, Jovan Battle, who represented himself during the trial, lay his head in his hand as the verdicts were read.

As he was led out of the courtroom, Battle extended his middle finger at the team of Cook County prosecutors and then grinned into the courtroom gallery where the murdered Officer John Rivera’s family sat. “See you later... and f--- you all too,” Battle said.

Battle did not fire the shots that killed 23-year-old Rivera, nor the volley that left Rivera’s friend, Ruben Sierra, critically injured, but prosecutors said the alleged gunman targeted the car because Battle pointed out Rivera and a carload of friends to the shooter.

Over four days of testimony, Battle had argued that he should have been charged as an accessory to the murder — a charge that does not exist in Illinois — rather than first-degree murder. Battle gave a disjointed, 35-minute closing argument that included his theory on the state’s accountability law, the structure of Chicago street gangs, and a biography that included a difficult childhood in the Cabrini-Green housing projects. He said considered his life an altruistic one if not one that he lived as drug-addicted panhandler who frequented the streets around the River North nightlife district.

“I’m a product of my environment,” Battle told jurors. “I have very intelligent thoughts. I never shot anybody. I never intended to shoot anybody.”

Battle was a sometimes combative figure in the courtroom during the trial, often spouting memorized bits of state laws and citing numbers from the criminal code. He often asked questions that indicated a misunderstanding of how the laws are applied and trial procedure. During breaks, outside the view of the jury Friday, Battle glared at and insulted police officers crowding the courtroom gallery and muttered at the four prosecutors seated across from him.

Battle, who has a history of mental illness, had fired his court-appointed public defender and was allowed to represent himself after passing a mental fitness evaluation.

Despite his scattershot, rambling approach to questioning witnesses, Battle had generally zeroed in on two points during the trial: establishing that he did not know his co-defendants or the victims before the shooting, and that he was not the one who shot into Rivera’s car.

Prosecutors Friday contrasted the changing versions of events Battle gave the night of the shooting — telling officers who arrested him that he had been at the scene, but hadn’t fired the shots; telling detectives he had helped his co-defendants because they were fellow members of a street gang who were confronting Hispanic rivals after getting “jumped”— with his statements in court that he had been trying to defuse the confrontation when, allegedly, Menelik Jackson opened fire.

Jackson and co-defendant Jaquan Washington had brawled with a group of Latino men outside the Rock ‘N Roll McDonald’s about an hour before Rivera, his girlfriend and two boyhood friends piled into Rivera’s Honda Accord after a night out in River North. Jackson and Washington were allegedly looking for members of the group they’d brawled with earlier when they encountered Battle on the street. Surveillance video showed Battle walking across Clark Street at Huron with Jackson, and pointing at Rivera’s car several times before Jackson rushed up to the driver’s side window and opened fire.

“You’ve had a chance to watch this guy for a week. You saw the video tape of him yelling and pointing,” said Assistant State’s Attorney Patrick Morley. “You saw him in the courtroom yelling and pointing. That’s what the defendant does when he wants to get something done.”

Jackson and another man, Jaquan Washington, still are awaiting trial.