QUEENS, N.Y. (PIX11) — The ex-con accused of fatally shooting NYPD Officer Jonathan Diller in Queens on Monday also tried to kill his partner — but the gun jammed, authorities said.

Guy Rivera, 34, allegedly pointed his weapon at Sgt. Sasha Rosen but the cop was able to move the gun away from him before Rivera redirected his aim at the sergeant, according to prosecutors. Rivera allegedly still had his hand on the trigger and was ready to fire again before the gun got stuck, according to the criminal complaint.

The chaotic sequence came moments after Rivera allegedly shot and killed Diller, 31, in the stomach after the officer approached two men in an illegally parked SUV near Mott Avenue and Smith Place in Far Rockaway at around 5:40 p.m., authorities said.

“The defendant opened fire and took the officer’s life and tried to shoot another member of the NYPD,” Queens District Attorney Melinda Katz said.

Authorities said Rivera and the driver, Lindy Jones, were in a Kia Soul when Diller told Rivera to step out of the vehicle. Rivera then allegedly fired the gun, hitting the cop below his bullet-proof vest, police said. Diller was rushed to the hospital but could not be saved.

Diller’s partner shot Rivera in the back before the injured Diller grabbed Rivera’s gun, according to authorities. Rivera remained hospitalized, as of Thursday.

After Rivera was arrested, cops found another weapon hidden inside his body, according to law enforcement sources.

Rivera was charged with murder, attempted murder, and criminal possession of a weapon, police said. He faces up to life in prison. His arraignment was pending Thursday.

Jones, 41, was charged with criminal possession of a weapon and defacing a firearm on Wednesday, authorities said. Police recovered a loaded 9mm gun from the glove compartment. The weapon’s serial number was scratched off, prosecutors said.

Rivera previously spent 10 years in prison on various charges, including assault, drug convictions and hate crime charges, according to authorities. Jones has more than 20 priors, including a gun charge from April 2023, according to Mayor Eric Adams.

Mira Wassef is a digital reporter who has covered news and sports in the New York City area for more than a decade. She joined PIX11 News in 2022. See more of her work here.