Paulo Virgen Mendoza, a 33-year-old Mexican national in the country illegally, pleaded guilty Thursday to murdering a California police officer nearly two years ago. He was sentenced to life without parole. 

Virgen Mendoza shot and killed 33-year-old Cpl. Ronil Singh, an immigrant born in Fiji, after being pulled over for suspected drunk driving early Dec. 26, 2018. 

The district attorney's office said earlier this year that it would seek the death penalty if Virgen Mendoza was convicted.

ICE ARRESTS 176 IN OPERATION RISE SANCTUARY CITY CRACKDOWN

This booking photo provided by the Stanislaus County Sheriff's Department shows Paulo Virgen Mendoza. Mendoza, suspected of gunning down a California policeman, was in the U.S. illegally and was captured while planning to flee to his native Mexico. (Courtesy of Stanislaus County Sheriff's Department via AP)

"The one fortunate thing for you, sir, is you are not going to be facing the death penalty, but you will never see the light of day outside the prison walls based on this conviction," Ricardo Cordova, the presiding Stanislau County judge, said at the hearing. 

Singh's widow, Anamika Singh, said she thinks Mendoza deserved the death penalty, but would accept life without parole. 

She brought her young child, who was just 5 months when his dad was killed, to the witness stand but took him back eventually because he was crying. 

NINTH CIRCUIT COURT RULES TRUMP CAN'T DIVERT MILITARY FUNDS FOR BORDER WALL

"I have lost my biggest support system. My son will never be able to receive his father's love," she said during emotional remarks Thursday.

"[My husband] wanted his son to be a police officer just like him, and now these are all shattered dreams."

This undated photo provided by the Newman Police Department shows officer Ronil Singh of Newman Police Department. (Stanislaus County Sheriff's Department via AP)

Stanislaus County Sheriff Adam Christianson said that Mendoza had two previous drunken driving arrests. But authorities couldn't deport him due to California’s sanctuary law, which prevents cooperation between local police and federal immigration authorities. 

President Trump got involved in the proceedings, tweeting after Singh was murdered that it is “time to get tough on Border Security" and "Build the Wall!"

CLICK HERE TO GET THE FOX NEWS APP

Five other people, including two of Mendoza's brothers and his girlfriend, were convicted of trying to help him flee the United States immediately after the murder. 

"You will live with those consequences for the rest of your life. I hope that every morning when you wake up, you think about what happened and why you're here, why you're in prison," Judge Cordova said Thursday.

"That is a pain you will have, a pain your family will have, but the pain is a lot greater for the Singh family." 

The Associated Press contributed to this report.