The ex-con who shot NYPD Officer Jonathan Diller to death during a chaotic Queens car stop was sentenced Monday to 115 years to life behind bars for manslaughter, attempted murder and other charges.

The sentence, handed down Monday by Queens Supreme Court Justice Michael Aloise, came after a dramatic three-week trial which ended with a jury acquitting Guy Rivera, 35, of first-degree murder, but convicting him of aggravated manslaughter, attempted murder and gun charges.

“Your sentence to me was determined the second you pulled that trigger,” Aloise told Rivera as he handed down the lengthy sentence. “It took me five minutes to calculate the numbers. It’s going to take you a lifetime to calculate the damage you did and the grief you caused.”

Diller’s widow, Stephanie Diller, testified in court moments before the sentence was handed down about the agony she has endured.

“In a single moment, everything that was my life was gone,” she said. “I wanted a lifetime with him.”

“I did not get to hold his hand,” she added. “I did not get to say goodbye. I did not get to give him the love and the peace he deserved in his final moments.”

But she wasn’t even the biggest victim, Stephanie said.

“The person who lost the most is our son Ryan,” she said. “He will grow up without the love of his father.”

She went on to address her husband’s killer directly.

“Mr. Rivera, only you know what was in your heart that day,” she said.  “One day, you will stand before God and answer for what you did to Jonathan.”

“Your actions that day cannot be undone. Your actions that day gave me a life sentence without him,” she added. “When I leave this courtroom, I will no longer speak of you. I will no longer think of you.”

The verdict on the lesser charge angered Diller’s colleagues in the NYPD. While the murder acquittal does take life without parole off the table, the sentence means Rivera will nonetheless, barring appeals, likely spend the rest of his life in prison.

Diller’s mother also addressed the courtroom Monday.

“My world has been completely shattered. Everything feels empty without him,” Fran Diller said. “All I can feel is an unbearable ache of my son not being there.”

“I have looked at the defendant over the last two years, and at every single court hearing I have never seen any remorse, only a concern for himself,” she added.

Diller, 31, was working on his day off on March 25, 2024 as part of a five-officer team in the 101st Precinct, when another member of the unit, Sgt. Sasha Rosen, spotted an L-shaped object in the pocket of the suspect’s hooded sweatshirt on Mott Ave. in Far Rockaway.

Rosen and Diller followed Rivera until he got into the passenger seat of a parked Kia sedan, and a third cop, Detective Dario Fernandez, surrounded the vehicle. Diller got the attention of the other two members of his team, Detectives Veckash Khedna and Derval Whyte — and within seconds, Diller was shot in the stomach.

Prosecutors argued that Rivera reached for his gun and deliberately fired a single shot at Diller in an attempt to blast his way out of his inevitable arrest, then pointed his weapon at Rosen’s chest, but the gun jammed. Khedna fired twice after the fatal shot, wounding Rivera.

Rivera’s defense team contended that the gun went off inadvertently in a struggle after Rosen reached into the car and grabbed Rivera.

The jurors saw video of the shooting from several angles, including the officers’ body-worn cameras and from nearby security cameras, and heard testimony from Diller’s grief-stricken widow and the other member of Diller’s unit.