A suspected drunk driver accused of fatally shooting the California police officer who pulled him over was captured Friday as he tried to flee back to Mexico, where he lived before illegally crossing into the U.S., authorities said.

The sheriff whose agency was leading the investigation blamed California’s sanctuary law for preventing local authorities from reporting Gustavo Perez Arriaga to federal immigration officials for previous arrests. If the suspect had been deported, he said, Cpl. Ronil Singh of the tiny Newman Police Department would still be alive.

“We can’t ignore the fact that this could have been preventable,” Stanislaus County Sheriff Adam Christianson said, asking why the state was “providing sanctuary for criminals (and) gang members. It’s a conversation we need to have.”

Following a statewide manhunt, Perez Arriaga was arrested on a murder warrant in a house near Bakersfield, about 200 miles (320 kilometers) southeast of the scene of the shooting.

As a SWAT team was preparing to raid the house, Perez Arriaga came out with his hands up and surrendered. He was taken back to Stanislaus County in the slain officer’s handcuffs,

.

Perez Arriaga crossed the border in Arizona several years ago and had worked a variety of jobs as a laborer, including at several dairies. He also had two prior arrests for driving while intoxicated, Christianson said.

The 33-year-old Mexico native had gang affiliations and multiple Facebook pages with different names, the sheriff said.

The shooting on Wednesday came amid a political fight over immigration, with President Donald Trump and congressional Democrats at odds over funding for a border wall that has forced a partial government shutdown.

Trump tweeted about Singh’s killing Thursday, saying it was “time to get tough on Border Security. Build the Wall!”

Neither Gov. Jerry Brown, who signed the sanctuary law last year, nor Attorney General Xavier Becerra, who has defended it in court, immediately responded to a request for comment. Brown has said the law strikes a balance between protecting families while ensuring consequences for serious criminals.

A federal judge upheld the law earlier this year in the face of a challenge from the Trump administration.

Authorities also arrested five other people, including the suspect’s brother, 25-year-old Adrian Virgen, and a co-worker, 32-year-old Erik Razo Quiroz, who lied to police to try to protect him, Christianson said, adding that both men were also in the country illegally.

, Youngblood said.

about the need to make laws stricter as Singh’s brother wept beside him.

Singh, also 33, was an immigrant too, arriving legally from his native Fiji to fulfill his dream of becoming a police officer, authorities said. He had a newborn son and joined the 12-officer Newman police force in 2011.

“He came to America with one purpose, and that was to serve this country,” Newman Police Chief Randy Richardson said, choking up. He called Singh an “American patriot.”

Singh, the department’s first officer to die in the line of duty, drove more than two hours each way to attend the police academy in Yuba City, Richardson said. He joined the Merced County sheriff’s office as a reserve officer and worked as an animal control officer in Turlock before being hired by the Newman force in 2011.

English was Singh’s third language. He had a thick accent but took speech classes to improve his communication, the chief said.

When the suspect began firing, Singh tried to defend himself but apparently did not hit the suspect, Christianson said.

(Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)

Autoplay Caption