LOS ANGELES (CNS) — A felon who led police on a chase from El Sereno to North Hollywood and held officers at bay for about three hours last year was sentenced to 33 years in state prison.

Los Angeles Superior Court Judge Katherine Mader refused to allow Nolan Perez, 42, to withdraw his no contest plea from June 24 to two counts of assault on a peace officer with a semiautomatic weapon and one count each of criminal threats against an ex-girlfriend and attempted carjacking.

Perez — who had multiple prior convictions including one for domestic violence in 2011 — pointed a loaded semiautomatic rifle at police during a high-speed chase that lasted nearly an hour before he ran into a North Hollywood residence, where he remained for three hours and fired at police before he was arrested on June 9, 2014, according to the District Attorney’s Office. No one was struck.

Shortly after police fired tear gas canisters into the residence, he

came out unarmed and dropped face-down on the ground. SWAT officers moved in and took him into custody.

He has remained behind bars since then.

Outside court Tuesday, Dec. 1, defense attorney E.J. Montanez — who handled the case with colleague Genevieve Cruise — said Perez decided to accept the plea deal because he could have faced life in prison if he had gone to trial and been convicted.

“He was highly under the influence of alcohol and drugs prior to that. He doesn’t remember any of the events,” the attorney said.

“He has a tumor in the brain that alters his behavior, especially when he is under the influence of drugs and alcohol … He did not mean to act the way he did.”