U.S. Immigration and Customs Enforcement officers make an arrest in February during an operation in Los Angeles. (Charles Reed/AP)

Deportations from the interior of the United States are rising under President Trump as the administration expands enforcement from the U.S.-Mexico border and into immigrant communities deeper inside the country.

From Jan. 22 to Sept. 9, officials deported nearly 54,000 immigrants from the interior, a 34 percent increase over the same period last year, and said that they expect the numbers to climb.

But U.S. Immigration and Customs Enforcement suffered a major blow Thursday when California Gov. Jerry Brown (D) signed legislation designed to shield thousands of immigrants from deportation. The law takes effect Jan. 1.

“These are uncertain times for undocumented Californians and their families,” the governor wrote after signing the bill limiting the state’s cooperation with ICE. He said the legislation would bring “a measure of comfort to those families who are now living in fear every day.”

On Friday, ICE acting director Thomas Homan blasted the law, which he said will “undermine public safety” and compel agents to arrest immigrants at work or home instead of picking them up at jails once they post bail. He also suggested that the law will increase the possibility that undocumented immigrants with no criminal records will be arrested.

“ICE will also likely have to detain individuals arrested in California in detention facilities outside of the state, far from any family they may have,” he said in a statement.

The California law is the latest contrarian effort since the Trump administration took office vowing to deport undocumented immigrants — including 2 million to 3 million criminals, though it has not come close to doing so.

In addition to the California law, cities and towns in Texas are battling in federal court over a new state law that requires local jurisdictions to hold immigrants arrested for local crimes past their release dates so that federal agents can take them into custody and try to deport them. An appeals court recently allowed part of that law to take effect. The two states are home to the largest populations of undocumented immigrants, accounting for 4 million of the 11 million people in the United States illegally.

Federal judges have also temporarily blocked the president’s January executive order that sought to restrict federal funding to what are known as sanctuary cities, which limit their cooperation with immigration agents.

The lawsuits and state policies are playing out amid increasing anxiety among immigrants across the nation. Last month, the Trump administration announced that it will phase out an Obama-era program that protected from deportation 690,000 undocumented immigrants brought to the United States as children.

Congress is considering legislation that would extend protection for the young immigrants, but in exchange, some conservative lawmakers are pushing for increased immigration enforcement.

For now, immigration officials said that they are forging ahead with arrests, which are up more than 40 percent this year. But they acknowledged that sanctuary cities are making it difficult to increase the number of annual deportations to past levels.

From 2008 to 2011, which included part of President Barack Obama’s first term, officials deported more than 200,000 immigrants from the interior every year.

Back then, immigration officials had ready access to local prisons and jails, which made it easier to detain and deport criminals. Obama also expanded a fingerprint-sharing program, Secure Communities, that alerts immigration agents when potential undocumented immigrants are arrested for local crimes.

But once local officials realized that immigration agents were also scooping up immigrants arrested for minor violations, such as traffic offenses, they severely limited their cooperation with ICE, becoming sanctuary jurisdictions. These policies, and Obama’s own restrictions on immigration agents, resulted in a sharp drop in interior deportations. Since 2012, the majority of deportations have happened along the southern border.

Trump’s critics say immigration agents are portraying hard-working immigrants as criminals and destabilizing their communities, making immigrants afraid to report crimes or even venture outside.

Last month, federal agents arrested nearly 500 immigrants in sanctuary cities and towns, including Baltimore and D.C., and vowed to return “every week” if they refuse to cooperate.

“We’re not sleeping well at night,” said Dave Cortese, president of the board of supervisors in California’s Santa Clara County, which filed one of the federal lawsuits against Trump’s efforts to yank federal funding from sanctuary jurisdictions. “We’re on high alert all the time.”

But Homan, the ICE acting director, said sanctuary policies often shield immigrants who have been accused, or convicted, of serious crimes. As an example, immigration agents said they asked the Sonoma County Sheriff’s Office in August to hold Nery Israel Estrada Margos, a Guatemalan man arrested for felony domestic violence. Instead, they released him on bail, and days later he was arrested for allegedly killing his girlfriend, Veronica Cabrera Ramirez.

The Sonoma County Sheriff’s Office said it shares information with ICE but does not hold immigrants after they are granted bail because some courts have ruled that officials do not have the authority to do so.

Although the Trump administration’s chief goal is to deport criminals, it is still expelling significant numbers of people who never committed any crimes. From January to Sept. 9, ICE deported a total of 142,818 immigrants from the border and the U.S. interior, including 83,254 people who were criminals and 59,564 who were not.

Among the noncriminals deported are Lizandro Claros Saravia and his brother Diego; Lizandro was a soccer star in Maryland who had a college scholarship but instead was sent to El Salvador. Also deported there this year was Liliana Cruz Mendez, a Falls Church woman whose driving offense was pardoned by Virginia Gov. Terry McAuliffe (D). Roberto Beristain, an Indiana restaurant owner who had been in the United States for nearly 20 years, was deported to Mexico.

Federal records show that 92 percent of the 97,482 immigrants arrested this year for deportation have been convicted of a crime, have charges pending, were immigration fugitives or had been previously deported.