A California sheriff is calling for immigration reform in his state after he says sanctuary city policies freed a violent illegal immigrant who went on to shoot a police officer and lead cops on a wild, high-speed chase.

Guadalupe Lopez-Herrara, 51, was taken into custody Thursday, a day after the Merced County’s Sheriff’s Office says Lopez-Herrara shot a deputy attempting to arrest him for allegedly violating a restraining order, FOX26 reported.

US ATTORNEY SAYS GOVERNMENT WILL SEEK FEDERAL CHARGES AGAINST KATE STEINLE’S KILLER

"This person is not a legal citizen within the United States," Merced Sheriff Vernon Warnke said at a press conference Thursday. "We had him in our custody in January of this year. And because of the folks in Sacramento limiting our ability to cooperate with ICE, we could not turn him over."

The deputy, a sergeant with the sheriff’s office, sustained non-life threatening injuries after police say Lopez-Herrara, described as a known violent criminal, shot him in the leg and vest Wednesday.

A shootout subsequently broke out between Lopez-Herrara and deputies -- but Lopez-Herrara managed to hide behind shrubbery and open fire, pinning down cops long enough to allow his escape.

TRUMP ADMIN REVERSES COURSE ON ALLOWING TEMPORARY EMERGENCY DEFERRAL FOR ILLEGAL IMMIGRANTS FACING DEPORTATION

Several law enforcement agencies launched a manhunt but were unable to locate him until the following morning. A high-speed pursuit ensued after Lopez-Herrara was spotted in a stolen truck on Highway 46, FOX26 reported.

The chase -- which reached speeds of 120 mph -- ended when Lopez-Herrara hit a spike strip.

Police say Lopez-Herrera fired shots at them from inside the vehicle, but he was stopped by a K-9 and taken into custody.

"Bottom line is our immigration policies need to be revamped because we're gonna continue to have more of this situation happen...We knew ahead of time this guy's potential for violence was there,” Warnke said.

CLICK HERE TO GET THE FOX NEWS APP

Sanctuary city laws in California have limited local law enforcement’s ability to convey information to federal agencies about illegal immigrants taken into their custody.

Warnke said Lopez-Herrara has a violent history that includes assault with a deadly weapon, felony assault, spousal abuse and possession of narcotics.

He is currently being held at the Merced County Jail.