SAN DIEGO (Reuters) - San Diego County leaders voted on Tuesday to join the Trump administration’s court challenge to a California law limiting cooperation with federal immigration enforcement, amid a conservative backlash to the so-called sanctuary movement.

People protest outside the San Diego County Administration Center ahead of a meeting where the county supervisors are expected to vote to support the Trump administration's lawsuit challenging California's so-called sanctuary statute, in San Diego, California, U.S., April 17, 2018. REUTERS/Jennifer McEntee

The Republican-controlled Board of Supervisors voted to direct the county attorney to file a friend-of-the-court brief supporting the administration’s lawsuit at the first available opportunity, which is likely to be on appeal, board Chair Kristin Gaspar said.

The 3-1 vote during a closed-door session, with one of the five supervisors absent, followed an hour-long packed public hearing on the matter.

Outside, pro-sanctuary protesters peacefully picketed the meeting, carrying signs with slogans such as “Sanctuary Cities Make Us Safer,” and “We Are All Immigrants.”

The action by leaders of California’s second-largest county followed a similar move last month by the all-Republican board of supervisors for neighboring Orange County, the state’s third-most-populous county.

The city council of the tiny Orange County municipality of Los Alamitos went even further on Monday night, approving an ordinance to “exempt” the town of about 12,000 people from the state’s sanctuary law.

The city of San Diego ranks as California’s second-biggest by population, and with the adjacent Mexican city of Tijuana, comprises the largest cross-border metropolitan area shared between the United States and Mexico.

California moved to the forefront of political opposition to Republican President Donald Trump’s crackdown on illegal immigration with enactment last year of the first statewide law aimed at restricting local law enforcement participation in federal deportation activity.

The measure bars state and local authorities from keeping undocumented immigrants who are incarcerated locked up any longer than otherwise necessary for the purpose of allowing U.S. immigration agents to take them into custody. It also prohibits police from routinely inquiring about the immigration status of people detained in an investigation or in traffic stops.

But the law, known as SB-54, allows local police to notify the federal government if they have arrested an undocumented immigrant with a felony record and permits immigration agents access to local jails.

The Trump administration has harshly criticized California’s law and similar sanctuary ordinances adopted by local governments across the country, saying they threaten public safety by protecting criminals who should to be deported.

Sanctuary supporters counter that enlisting police cooperation in deportation actions undermines community trust in local law enforcement, particularly among Latinos, and that Trump’s crackdown has targeted some immigrants over minor infractions.

The U.S. Justice Department sued California over SB-54 in February, claiming federal law pre-empts the statute, in a move Democratic Governor Jerry Brown denounced as a declaration of war on his state.

Since then, however, local politicians in a number of California’s more conservative cities and counties have pushed back against the sanctuary movement, approving resolutions in support of the Trump administration lawsuit.