Bed space was so hard to come by inside immigrant detention facilities across the country last fall that federal officials scrambled to rent out extra room in county prisons and jails. Immigration and Customs Enforcement, the Department of Homeland Security’s immigration-enforcement arm, had thousands more immigrants in custody than it had the capacity to detain. As a result, hundreds of Haitian immigrants wound up wherever there was open jail space, often in remote regions like the Yakima County jail in eastern-Washington state and far from where they were first apprehended at the southern border.

The federal immigrant detention network was bursting at the seams even before President Donald Trump entered office. Those problems will likely exacerbate after the president vastly expanded the pool of immigrants up for deportation. The Obama administration put in place a solution that is already proving beneficial to Trump: a blueprint on how to outsource immigration enforcement to local cops, leveraging their resources and infrastructure to execute Trump’s proposal to detain and deport millions of undocumented immigrants who have “criminal records.”

In January, Trump signed an executive order on immigration enforcement that included measures to ramp up a program known as 287(g), which deputizes local law enforcement officers to double as federal immigration agents. Once trained, local officers are authorized to interview, arrest, and detain any person who may be in violation of immigration laws. Thirty-eight law enforcement agencies are currently collaborating with ICE, according to the government’s latest figures. But a report released by the Immigrant Legal Resource Center in December found that the overwhelming majority of the 2,556 counties surveyed didn’t need formal programs: They were already offering assistance to ICE.

An early example is the Milwaukee Sheriff’s Department, led by Trump surrogate David Clarke, which teamed up with ICE for a 2-day raid in Wisconsin that ended on the same day that the president signed his executive order enlisting help from local law enforcement. The sheriff’s department has not formally entered agreements to join the 287(g) program. Still, local law enforcement played an active role in arresting 16 undocumented immigrants, all of whom authorities said had previous criminal convictions ranging from assault to drug possession.

Trump celebrated this mutual alliance with local law enforcement earlier this month by inviting sheriffs from across the country to the White House. The local leaders emerged from the meetings emboldened by the enthusiastic backing they received from the president. Some floated ways to target elected officials in so-called “sanctuary cities” that refused to cooperate with the feds. (A crack down on these jurisdictions was also included in Trump’s executive order.) “As far as I’m concerned, if you want to straighten out these people who are refusing to allow the federal government to enforce the law, then if they’re harboring illegal immigrants, you give them an arrest warrant,” said Sheriff Thomas Hodgson of Bristol County, Massachusetts.

Trump claimed credit for keeping his campaign promise to crackdown on illegal immigration after federal officials confirmed that more than 600 undocumented immigrants had been arrested across the country. Department of Homeland Security Secretary John Kelly described the operations as “routine” in a statement Monday. But immigrant rights groups fear this is just the beginning. And while President Obama earned a reputation as the “deporter in chief” for removing more undocumented immigrants than his predecessors, advocates say Trump has set the tone for what they expect to be an era of unprecedented enforcement. “The level of anxiety and fear has increased tremendously,” Cristina Jiménez, the executive director of the advocacy group United We Dream, told reporters Monday. “What is clear under Trump’s executive order is that everyone is a criminal.”

Trump made countless more undocumented immigrants vulnerable to deportation by casting virtually any run-in with local police as grounds for removal. Enforcement of the order, however, will likely lead to haphazard results, says Lena Graber, co-author of the ILRC report, because of how much the directives leave up to interpretation. “It’s good for intimidating people—bad for creating consistency or any predictability about what the government will do,” Graber said.

Uncertainty around how the new enforcement measures will be carried out on the local level is already rattling immigrant communities. ICE agents sparked panic in San Francisco last month after they mistakenly stormed a building with a preschool on site while on the hunt for an undocumented immigrant whom they say is a convicted sex offender. Former Mission District Supervisor David Campos called the incident “unusual.”

The aggressive enforcement measures stand to test resources that are already maxed out to the limit, with immigrant detainee totals estimated to top 47,000 by mid-2017, The Wall Street Journal reports—far above levels funded through Congress. ICE has already secured new detention space at three new facilities within the last several months by contracting out private, for-profit prison companies to begin housing new immigrants. A facility in Georgia is set to hold 780 immigrant detainees, while another private prison based in Ohio will have the capacity to hold 2,000 early this year. A final location is planned in Cibola, New Mexico, where a private-run detention center will hold up to 1,116 immigrants, said ICE spokeswoman Jennifer Elzea.

The federal government has long relied on partnerships with local jails to cut down on transportation costs and shore up detention space in remote regions. It’s an economic boom for cash-strapped municipalities that are paid out at a daily rate to house immigrants for indefinite periods—Hodgson boasts that his local immigrant detention operations generate millions of dollars in revenue each year. In regions that have large vacancies in their jails or detention centers, like the Baltimore suburb of Anne Arundel County, lucrative deals are becoming hard to pass up.

“The county had been approached numerous times about housing individuals that ICE has detained,” said Owen McEvoy, a spokesman for the Anne Arundel County executive. Plans to lease out detention space there have been met with resistance from local leaders who voiced unease with the prospect of potentially profiting off detaining undocumented immigrants. It matches a growing trend in regions across the country wanting to send a more welcoming message to its local undocumented immigrant communities.

One major difficulty in these agreements is finding locations able to hold immigrants in the civil detention system, not punitive, meaning they are afforded greater freedoms than inmates held in prisons on criminal convictions. However, activists charge that this line is often blurred.

Fainot Pierre, a Haitian-American student and U.S. Army veteran, has been actively seeking assistance for Haitian immigrants after finding that more than 130 of them were being held in the Otero County Prison Facility in New Mexico. The Department of Homeland Security had suspended deportations of Haitian immigrants in the wake of a series of natural disasters that struck the country. But last September, the administration said it would resume removals “on a more regular basis.”

Pierre scrambled to find them legal help and access to translation services, but instead he witnessed what happens to many immigrants shuttled through state or locally-operated facilities—nearly all were deported within weeks of their arrival.