Jose Armando Escobar-Lopez and his girlfriend were driving home from church one Saturday evening when they were pulled over by a Daly City police officer. Escobar-Lopez, who was behind the wheel, didn’t have a criminal record. But he was living in the country illegally and driving without a license.

In California, that wouldn’t have gotten the 21-year-old immigrant from El Salvador into trouble with immigration authorities because the state’s sanctuary law, implemented in 2018, largely prohibits police from cooperating with ICE unless an individual commits a serious crime.

But on May 11, the police officer arrested Escobar-Lopez then turned him over to federal immigration officials. Now, Escobar-Lopez may be deported.

At issue is whether Daly City police violated the state sanctuary law, SB54. The police officer’s actions are also raising questions about what the consequences should be for violations of SB54. Attorneys say consequences may include claims for damages and lawsuits, local policy changes and retraining for officers.

Daly City police did not respond to a request for comment, but City Attorney Rose Zimmerman said police followed protocol. She called the episode an “isolated incident.”

“We’ve never had a situation like this,” Zimmerman said. “The city very much follows all California sanctuary laws that have been in place. I know the (city) council and the Police Department would like for us to continue to review that our policies are in line with sanctuary policies.”

Zimmerman said Daly City Police Chief Patrick Hensley wrote letters to Immigration and Customs Enforcement and to the Board of Immigration Appeals asking for Escobar-Lopez’s release.

Now Playing:

Those letters are proof the department overstepped its authority, Escobar-Lopez’s attorney, Jessica Yamane, said.

“Actions speaks for themselves,” said Yamane, an attorney at La Raza Community Resource Center. “If there was no fault in some way by the DCPD ... I don’t think that’s the tack that the city attorney would take to support somebody that their own Police Department detained.”

ICE confirmed Escobar-Lopez was arrested May 11 for “immigration violations” and said a judge had first ordered him deported in September 2017. An ICE spokesman declined to elaborate on the judge’s decision.

“Escobar-Lopez is currently in ICE custody pending his removal to El Salvador,” ICE said Tuesday.

Escobar-Lopez, who has lived in the U.S. since 2015, was scheduled for deportation Wednesday but was granted an emergency stay of removal Tuesday by the Board of Immigration Appeals, which has temporarily prohibited the Department of Homeland Security from deporting him. The board will determine whether to re-open his case.

He remains in custody at the Mesa Verde Detention Facility in Bakersfield.

Advocates said Escobar-Lopez was first ordered deported after he failed to show up to a court hearing but said he was never notified of the court date.

Escobar-Lopez’s girfriend, Krisia Mendoza, and Yamane said that the police officer who pulled Escobar-Lopez over did not provide a reason for the traffic stop and questioned Escobar-Lopez about his immigration status — claims that Zimmerman denied Tuesday.

Zimmerman said Escober-Lopez was pulled over because he had been swerving in and out of lanes. The officer then learned that he was driving without a license. When the officer looked him up in a law enforcement database, he saw a 2017 deportation order for failing to appear in court, she said.

After arresting him and taking him to the Daly City police station, officers notified ICE. In a video obtained by the Asian Law Caucus through a public records request and viewed by The Chronicle, an ICE agent is seen handcuffing Escobar-Lopez as a police officer looks on.

The organization is working with Escobar-Lopez’s attorney to file an administrative claim against Daly City.

SB54 has not stopped local law enforcement agencies from cooperating with immigration authorities, pushing the limits on a historic law that was praised as a game-changer for immigrant communities.

A March study by the Asian Law Caucus in San Francisco and the University of Oxford revealed 40% of the police agencies studied are using legal loopholes and outdated law enforcement policies to cooperate with ICE, or are violating the sanctuary law altogether.

Tatiana Sanchez is a San Francisco Chronicle staff writer. Email: tatiana.sanchez@sfchronicle.com. Twitter: @TatianaYSanchez.