Menelik Jackson grabbed his gun and set out for revenge early Saturday morning. He had a score to settle, police say, and was looking for the men who’d apparently wronged his friend.

Moments earlier, Jackson’s friend was punched in the face during a “petty dispute” with a group of Hispanic men on a party bus. So Jackson left the scene of the dispute, only to return to the area shortly after 2:30 a.m., armed with a .40-caliber handgun.

But the bus — and the men inside — were gone.

It was happenstance that John Rivera, an off-duty police officer in Chicago’s 6th District, left a nearby pizza bar with three friends around 3:30 a.m. and piled into a car. It was then, police say, that 24-year-old Jackson opened fire into Rivera’s vehicle, killing the 23-year-old officer and critically wounding one of his friends.

At a Monday news conference, Chicago Police Superintendent Eddie Johnson said the “act of cowardice” was fueled by Jackson’s desire for vengeance. When he couldn’t locate the men from the party bus, Johnson said, Jackson instead took aim at Rivera — “the first Hispanic man that he came in contact with.”

“Officers in Rivera’s 6th District class are suffering right now,” Johnson said. “They lost a friend . . . lost a young guardian who wanted nothing else but to make the city he grew up in safer.”

Jackson, who police say confessed to the shooting, is charged with first-degree murder and three counts of attempted murder. He will also be charged with resisting arrest for attempting to fight officers, and police will seek hate crime charges against the man for allegedly targeting Rivera. Jovan Battle, a 32-year-old who reportedly stood with Jackson as he fired into the vehicle, was also arrested and charged with one count of murder and three counts of attempted murder.

Police are still searching for a third suspect, who was punched in the face earlier in the night, who they say was also with Battle and Jackson during the shooting.

Johnson called Rivera’s death a “nightmare” and noted that Jackson has a history with the department. The suspect had once applied to be a Chicago police officer, but was arrested and convicted of committing an armed home invasion during the background check process.

Citing court records, the Chicago Tribune reported that on July 3, 2017, Jackson broke into his ex-girlfriend’s apartment and put a gun to her head.

The victim, a woman in her early 20s, reported to police that Jackson was going to the Chicago police academy that same day to take a polygraph test to become an officer, according to the Tribune. Police notified the academy, and instead of taking the test, Jackson was arrested on home invasion and weapon charges. He would later plead guilty to attempted residential burglary. Jackson also has two convictions for domestic violence, according to Johnson.

“The most egregious part about him is he also once thought he had what it took to wear a Chicago police star,” Johnson told reporters Monday. “Today, he stands accused of committing the ultimate disgrace to everything this star stands for.”

Battle has an “18-page criminal history” with 10 convictions for violent crimes, Johnson said, including assault, battery and felony narcotics.

Rivera’s friend who was critically wounded in the attack is now in stable condition and is expected to survive. The Tribune reported that the two others in the vehicle, including another off-duty officer, were not harmed.

William J. Bradley, 6th District commander, said at the news conference that Rivera sought to make to make the city “safer and better” every day. His team is struggling in the wake of Rivera’s death, Bradley said.

“John was not only a police officer; he was a son, a nephew, a cousin, but he was part of our 6th District family,” Bradley said. “All he wanted to do was help people.”

Correction: A headline on some digital versions of this story incorrectly said that the alleged shooter was a police officer. John Rivera, the victim, was an officer. Menelik Jackson is not.

Read more:

Father of Sandy Hook shooting victim found dead in apparent suicide, police say

Florida neighborhood besieged by thousands of poisonous frogs ‘covering every square inch’

German billionaire family that owns Einstein Bros. Bagels admits Nazi past