The biggest setback the Trump administration has suffered so far in the 2018 primaries might have come in a sheriff’s race in Mecklenburg County, North Carolina — where the victorious challenger has promised to reduce his office’s cooperation with federal agents of Immigration and Customs Enforcement (ICE). Alternatively, it might have been in a sheriff’s race in the state’s Durham County, where another incumbent got swept out by a challenger who promised to end local cooperation with ICE requests entirely.

Progressive victories in local criminal justice races — including prosecutors as well as sheriffs — have been a trend in the early stages of the 2018 cycle. Unlike most criminal justice policy, though, immigration policy is set by the federal government; the only choices local officials can make are how easy to make the jobs of ICE agents in identifying and apprehending deportable immigrants.

But new data suggests that under President Trump, the decisions that local officials make about cooperating with ICE — or refusing to cooperate — actually matter a lot for ICE’s ability to ramp up arrests and deportations. The trend of blue “sanctuary” cities and states where many unauthorized immigrants live reducing cooperation with ICE (even while it expands elsewhere) could make it extremely hard for the Trump administration even to return immigration enforcement to the levels of President Obama’s first term. And the new sheriffs in town in North Carolina’s Mecklenburg and Durham counties are poised, when they get sworn in after the November elections, to restrict ICE’s access further still.

Sheriffs who ran on reducing ICE cooperation won in North Carolina

Mecklenburg County, which includes Charlotte, has long been at the forefront of local cooperation with ICE. Its first agreement with the federal government to deputize local officials to help enforce immigration law (known as a 287(g) agreement) was signed in February 2006; the sheriff at the time acknowledged that its goal was to apprehend and send to ICE as many unauthorized immigrants as possible. It became a model for 287(g) agreements in the Southeast.

More than 15,000 people have been put in deportation proceedings in Mecklenburg County as a result of the 287(g) agreement.

But that era is coming to an end. In Tuesday’s Democratic primary, incumbent Sheriff Irwin Carmichael (who signed the latest version of the county’s 287(g) agreement) was beaten by challenger Gerry McFadden, who made abolishing the agreement part of his platform. “287(g) is going to be history,” McFadden proclaimed at his victory party on Tuesday. “It is going to be an event.” (Because no Republican candidates have entered the race, winning the primary is tantamount to winning the election, though McFadden won’t be sworn in until 2019.)

The end of 287(g) doesn’t mean the end of deportations in Mecklenburg — state and local officials can’t prevent ICE from coming in and arresting people for deportation — and still leaves the door open for some participation with ICE. Ending 287(g) will stop immigration enforcement in local jails by sheriff’s deputies but doesn’t necessarily bar ICE officials from coming into jails to check inmates’ immigration status.

McFadden still has to resolve the question of whether he’ll start declining ICE “detainers”: requests from ICE to hold people in custody up to 48 hours after they’d otherwise be released to give federal agents a chance to pick them up.

ICE detainers were a focus of another North Carolina sheriff’s race, in Durham County. Incumbent Mike Andrews, who had promised to keep honoring the requests, lost. His successor-to-be, Clarence Birkhead, has promised to stop honoring them.

Immigration was a key issue in these races, especially in Mecklenburg. Reducing cooperation with ICE wasn’t an auxiliary outcome of electing a candidate who’d run on other things; it was a key distinction between the candidates, and the candidate who promised to reduce cooperation won. One activist in Charlotte boasted that McFadden won on the backs of “single-shot voters”: Latinos and others who voted only in the sheriff’s race.

These races weren’t just about politics or the victory of one vision for America over another. Once these sheriffs are sworn in, their new policies are likely to have an immediate impact on the lives of their immigrant residents — and further divorce the places ICE can most efficiently deport immigrants from the places most immigrants actually live.

In Trump’s America, how safe an immigrant is from deportation depends on where she lives

Under Trump, a lot more immigrants living in the United States are being arrested and put into deportation proceedings than under the last years of the Obama administration. But they haven’t yet surpassed Obama’s first term, when more than 400,000 immigrants a year were being deported and local-federal cooperation was at its peak. A new study from the Migration Policy Institute, a nonpartisan immigration think tank, suggests that maybe they never will.

The report’s authors visited 25 local jurisdictions in the first months of the Trump administration to document immigration enforcement on the ground.

One of their conclusions was that efforts in blue states and cities to reduce local cooperation with ICE really have hampered the ability of ICE agents to book immigrants into custody. California has led the way, passing a state law that limits local officials’ ability to honor detainer requests and bars ICE officials from accessing county jails in many cases — and which has inspired a federal lawsuit from Jeff Sessions’s Department of Justice. Other states and cities had reined in their cooperation under Obama, ending their 287(g) agreements or setting restrictions on when to honor detainer requests, and are unlikely to bring them back under Trump.

Immigrants are still getting deported from those places, but it takes more effort to find them and apprehend them, so fewer of them can be rounded up. Because so many of America’s unauthorized immigrants live in these places, the MPI report concludes, the increased cooperation ICE is getting from rural and scattered counties isn’t enough to make up for the lost efficiency.

It’s possible that ICE just can’t return to 2011 levels of enforcement, at least without an unprecedented infusion of funds from Congress. (And Congress has been unwilling to write the Trump administration blank checks on immigration.)

The major exception is Texas, where a state law mandates that local officials cooperate with ICE. So far, the ICE field office that covers North Carolina, South Carolina, and Georgia has been another exception: ICE arrests of immigrants jumped 53 percent from fiscal year 2016 to fiscal year 2017, according to MPI. (Those three states contain about 7.3 percent of the US’s unauthorized immigrants as of 2014, but accounted for 9.4 percent of 2017 arrests.) Mecklenburg County’s 287(g) agreement could be one factor in this, the MPI authors note, since it’s one of the remaining counties with a substantial immigrant population cooperating with ICE.

But it won’t be cooperating anymore — or at least, not fully. Because county jails are ICE’s point of access to local law enforcement, sheriff’s department policies matter a lot. ICE is now losing its ease of access to two counties with a relatively large share of unauthorized immigrants. Mecklenburg County’s unauthorized population ranked it 35th in the country in 2014, according to MPI data, but over a dozen of the more populous counties were in California, and several more were in other places that have restricted ICE cooperation.

“The fortunes of an unauthorized immigrant,” the MPI report concludes, “are quite different in Texas, Tennessee, and Georgia, where the mere act of driving can result in arrest and deportation” (because police routinely arrest unauthorized immigrants for driving without licenses they can’t legally obtain, and cooperate in turning them over to ICE) “than in California, Chicago, and New York.” Mecklenburg and Durham counties are about to move closer to the noncooperative end of that spectrum — the end where immigrants face lower risk of deportation.

If ICE keeps losing efficient access to the places where unauthorized immigrants live in great numbers, it will likely their capacity across the board. In the meantime, those places are where immigrants are most vulnerable. But as North Carolina shows, the places that have enough unauthorized immigrants for cooperation with ICE (or lack thereof) to make a difference are also places that have enough Latino US citizens (and sympathetic progressive allies) to elect politicians who will restrict it.