For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

On the day his office stopped complying with Immigration and Customs Enforcement, newly elected Sheriff Garry McFadden of Mecklenburg County, North Carolina, invited immigrant activists to a local bakery * to celebrate. Grinning, he cut into a white sheet cake that featured “287(g)” in black print at its center, slashed through with red icing, to symbolize an end to the department’s participation in the voluntary provision that allows ICE to ask sheriffs to hold undocumented immigrants after they’ve been arrested by the department.

“We just don’t do that work anymore,” McFadden said.

But soon, he may have to cooperate with ICE officials. In the months since he celebrated his election, McFadden has been fighting a public battle with the federal agency after an undocumented immigrant committed a high-profile crime, and state Republicans have jumped in to use the controversy as a campaign issue.

In June, North Carolina Senate Republicans passed a controversial new bill, HB 370, that would require sheriffs to comply with ICE detainers. (A slightly different version of the bill had already passed the House; Republican leaders have been delayed from sending the bill to the governor’s desk due to ongoing disputes over the state budget.) Democratic Gov. Roy Cooper has called the bill unconstitutional and says he plans to veto it. In a statement, Cooper grumbled that the bill, and the issue of immigration detention in general, has taken on a life of its own and become “about scoring political points.”

“It’s sad to see the governor has sided with radical open-borders liberals,” Rep. Destin Hall, a sponsor of the bill, said of Cooper’s decision. But less than a year ago, support for immigrants swung elections in the state.

In the 2018 election, black sheriffs were elected in North Carolina’s seven largest counties. McFadden was among them. The new sheriffs knocked off two 16-year incumbents, one of whom held the position for nearly 25 years, “largely because they objected to hardline immigration policies,” experts told the News & Observer. For the sheriffs, who manage their local jails, that meant ignoring requests from ICE to detain previously arrested undocumented immigrants so the agency could deport them. Such requests are made through a federal provision, 287(g), which allows ICE to work voluntarily with local authorities. At a press conference in Charlotte earlier this summer, McFadden, who has been one of the most outspoken of the new sheriffs, told reporters that the provision was “off the table.”

“You bring me a federal warrant,” he declared.

McFadden has a way of using the spotlight to his advantage. He is a sharp dresser—suits, cufflinks, the occasional bow tie—and he is at ease in front of the camera. For two seasons, he starred in I Am Homicide, a show on Investigation Discovery in which McFadden, a 30-year veteran of the Charlotte Police Department, explained murder cases he’d solved. “Do I push the envelope?” McFadden asks in the series intro. “I tear the envelope.” On his Twitter page, in the style of celebrities, he documents a joyous life with the occasional aside that “critics” only motivate him.

McFadden’s press conference was in defense of his policy not to comply with ICE voluntarily. A few days earlier, ICE had publicly criticized McFadden for the release of Luis Pineda-Ancheta, who they asked McFadden to hold in jail until they could arrest him. Pineda-Ancheta, who was arrested by Charlotte police for attacking a woman, was released in May; upon his release, he attempted to kidnap the same woman. (She got away because he tripped.) After a nine-hour SWAT raid, Pineda-Ancheta was arrested again. He met a $65,000 bond and was released once more. ICE finally arrested him in early June and chastised McFadden in a press release for “refus[ing] to honor an ICE detainer, nor even notify ICE…and instead releas[ing] an unlawfully present foreign national facing serious criminal charges onto the streets of Charlotte.”

Soon after, Republicans announced HB 370 after what they called a “public outcry” over the “ongoing controversy” involving McFadden and the other sheriffs. “These sanctuary sheriffs are simply putting partisan politics ahead of public safety,” said Rep. Hall. The ACLU called it “blatant political retaliation against the growing number of sheriffs in North Carolina who have pledged to not assist ICE,” and the Intercept reported that ICE helped craft the bill. None of the bill’s four sponsors responded to multiple requests for comment from Mother Jones, and ICE has said they do not publicly advocate for any legislation.

Sheriff policies in North Carolina don’t usually get much attention. “We’ve never had a situation during my tenure that has been as public as this,” said Eddie Caldwell, general counsel for the NC Sheriff’s Association, a group he’s worked with since 1996.

At first, the NC Sheriff’s Association opposed the measure because it felt that early versions of the bill curtailed the independence of sheriffs through special provisions like allowing ICE full access to jails. The organization ultimately opted to work with leaders in the North Carolina legislature on the bill—overall, Caldwell said the association supports the idea of ICE compliance via court order because it would protect sheriffs. Instead of deputizing sheriffs as potential ICE agents under 287(g), HB 370 would require they comply with ICE by a local court order.

Now, “that court order is what the sheriff will be honor[ing]; the sheriff will not be honoring the ICE detainer,” he said. It’s a bureaucratic workaround to require ICE compliance by sheriffs: You can refuse to comply with an ICE detainer. You cannot refuse to comply with a court order.

In Raleigh, McFadden spoke out against the measure. “The House bill clearly is about attacking a select group of sheriffs who now have been carefully identified by using code words such as ‘urban sheriffs,’ ‘sanctuary sheriffs,’ and the one that I heard in this House that was more disturbing than anything else: the ‘super minority-majority sheriffs,'” he said at a press conference.

He was backed by other newly elected sheriffs. “They’re trying to intimidate sheriffs to comply with these laws with the threat of removal of office,” said Bobby Kimbrough, who took over in Forsyth County. “That’s repugnant. That’s offensive.” Danny Rogers, a sheriff from Guilford County, ended his support for the bill after his cohort of sheriffs began speaking out. In Buncombe County, commissioners wrote a letter telling Cooper to veto the law. “This reminds me of the Jim Crow period I came up with when I was a kid,” said Al Whitesides, the only black member of the board. “Heaven forbid we go back there.”

McFadden’s refusal to cede to ICE is an issue in the state’s lingering election from the 2018 midterms. As GOP Sen. Dan Bishop campaigns as the Republican candidate in the still-undecided election in North Carolina’s 9th District—which is being re-run because of election fraud—he is using HB 370 as a way to prove his Trumpian immigration bona fides, calling on McFadden to resign and saying that refusing to comply with ICE is “a dangerous policy.”

When “sanctuary” sheriffs refuse to detain violent criminals to appeal to a fringe base, they put the public at risk. Tonight, voted in favor of HB 370 to make this a thing of the past. #ncpol #ncga — Dan Bishop (@jdanbishop) June 25, 2019

He bemoaned “sanctuary” policies on Twitter and linked to a story about an undocumented immigrant who was arrested for killing his ex-wife. (Bishop’s campaign did not respond to requests for comment.)

Bishop has also called for McFadden to resign and for his opponent, Democrat Dan McCready, to do the same. (McCready responded in a statement by calling for bipartisan immigration reform.) Brad Parscale, Trump’s 2020 campaign manager, praised Bishop. “Great job,” he wrote on Twitter.

Correction: An earlier version of this article misidentified the location of the celebration.