President Trump gives his support to Dan Bishop, a Republican running for the special North Carolina 9th District House race at a rally in Fayetteville, N.C., on Monday. (Chris Seward/AP)

President Trump and his Republican allies won a battle of political heft and symbolism in a North Carolina special election on Tuesday, maintaining their hold on a House seat after a last-minute visit by Trump, a campaign message that stoked fear over socialism, and the continued erosion of Democratic strength in rural counties.

But even as they reveled, the victory also reaffirmed a continued political realignment across the country that holds peril for Republicans, who have strengthened their hold on rural areas at the expense of once Republican-friendly suburbs, where growing opposition to President Trump helped deliver control of the House to Democrats in 2018.

The results were mixed for Democrats as well. In addition to losing the seat, they faced the reckoning about their continued difficulty in rural areas, and the taint on their candidate from high-profile Democrats in Washington.

But the close nature of Republican State Sen. Dan Bishop’s two-point win over Democratic businessman Dan McCready gave Democrats reason for optimism despite the loss. Less than three years ago, Trump had been able to carry Bishop’s district, which stretches from Charlotte to Fayetteville along the state’s southern border, by nearly 12 points.

“Clearly the political wind is still in the face of Republicans in many ways, particularly in the suburbs,” said Josh Holmes, a longtime adviser to Senate Majority Leader Mitch McConnell (R-Ky.). “But it’s also impossible to ignore the continued shift of rural Democrats firmly into the Republican camp.”

A similar 10-point shift from 2016 toward Democrats in 2020 would all but ensure Democrats keep control of the House, jeopardize several Republican-held Senate seats and potentially undermine Trump’s reelection hopes in states he won in 2016, such as Pennsylvania, Michigan and even North Carolina. There are 35 GOP House seats with less Republican-leaning electorates than the North Carolina district, according to the Cook Political Report.

Democrats in the state said they hoped Republicans take the wrong lessons from the result and further embrace a president who is repolarizing the electorate.

“I think it’s a huge strategic win for Democrats on that level — the fact that Trump is going to say: ‘See guys, look, stick with me and you can win,’” said Morgan Jackson, a North Carolina-based consultant who worked with McCready.

“By doing that, you’ve got suburbs and exurbs, much less urban areas in your district, that are going to underperform by five, by 10, by 15 points from just where he was a few years ago. It’s a really dangerous marriage for a lot of the Republicans running for Congress.”

Despite the shrunken margin, Trump allies rejected the idea Wednesday that the election result revealed any weakness for the party or the president’s reelection odds. Trump campaign manager Brad Parscale boasted in a call with reporters that he believes Democratic states such as New Mexico are within reach. He dismissed concerns of suburban flight from the GOP.

“I don’t feel like we have a problem,” Parscale said. “The president is clearly in the driver seat to win reelection.”

Republicans spent the day publicly crediting Trump’s visit Monday, and his private strategic guidance, with pushing Bishop over the line. At the Monday rally in Fayetteville, Bishop appeared onstage with nearly the same uniform as Trump: a dark blue suit and red tie.

“You have to understand that Trump totally dominated the news in the week leading up to Election Day,” said Scott Reed, a senior political strategist for the U.S. Chamber of Commerce, which ran a large digital and text-message effort for Bishop targeting business owners in the suburban parts of the district. “McCready couldn’t get arrested in the last 48 hours.”

But there were other factors that contributed to Bishop’s victory that few Republicans will be able to replicate elsewhere, including GOP overperformance relative to 2018 in areas of Robeson County populated by members of the Lumbee Tribe of Native Americans. Bishop did extensive outreach to that socially conservative community, trumpeting his efforts as a state lawmaker to increase grants to the tribe.

“He really understood the importance of that vote,” said state Rep. Charles Graham, a Democrat who represents western Robeson County and is the only Lumbee member of the general assembly. “I think he did a great job promoting his accomplishments.”

Beyond that area, the results revealed the same geographic trends that have come to define politics in the Trump era. Partisanship is deeper, base turnout is more important and moderate, better-educated swing voters are moving toward the Democrats. McCready won the Charlotte suburbs of Mecklenburg County by a 12-point margin, beating his nine- point margin in 2018.

In the last race in the district, Republican Mark Harris beat McCready in 2018 by less than 1,000 votes, but the results were later tossed out and a new election ordered after evidence emerged of absentee ballot tampering by Harris campaign staff.

Democratic enthusiasm allowed McCready, a retired Marine captain, to raise more than three times as much money as Bishop directly for Tuesday’s election. Under federal law, candidates receive lower broadcast advertising rates in the weeks before an election than outside groups spending on the same election. As a result, McCready and his allies were able to reach more people with their advertising than Republicans, despite similar overall spending on both sides.

Nonpartisan observers said Republicans should be cautious about seeing the result as a good sign.

“President Trump shouldn’t get credit for bringing a bucket to put out a fire that he started,” said Nathan Gonzales, a nonpartisan election forecaster for Inside Elections. “If everything stays the same and it is November of 2020, I don’t think President Trump wins that district by 12 points like he did in 2016.”

One difference from the 2018 election was Bishop’s ability to tar McCready, a Democratic moderate, by raising the records of other recently elected Democrats, including Rep. Alexandria Ocasio-Cortez (D-N.Y.) and Rep. Ilhan Omar (D-Minn.), who have tried to push the party to the left in recent months. In one of his ads, Bishop surrounded himself with inflatable clowns bearing the faces of McCready, Ocasio-Cortez and Omar, among other Democrats.

“I’ll go to Congress and fight these clowns for you,” he said.

Republican leaders in Congress said Wednesday that they believed the North Carolina message showed a path for winning back some of the suburban vote while maintaining the rural advantage.

“They do not want socialism. They do not want to see their private health insurance taken away. They do not want to see illegal immigrants given free health care. They do not want to see the economy destroyed by the Green New Deal,” said House Republican Conference Chair Liz Cheney (R-Wyo.). “I think that those voters are absolutely going to be in a position where they understand the choice, and I feel really good about us being able to make sure they come back to us.”

Several Bishop voters in Pineville, N.C., a Charlottesville suburb, explained their vote by pointing to the recent Democratic debates and more liberal policy proposals.

“The Democrats aren’t even left anymore; it’s the socialist Democratic Party now, not the Democratic socialist party,” said Keith Simms, 55, a conservative Republican. “I think they’ve put the socialism part first.”

Others cited their affinity with Trump. Umarin Davis, a 45-year-old cafe worker, said she voted Republican because she believes Trump has improved the lives of working class Americans.

“I’m working class, and in society I don’t feel we are really appreciated as much as the middle class, or the one percent,” she said. “We were going around the wheel everyday and didn’t know where we were going until Trump showed us the light. He showed us there is some improvement if we come together. ”

Additional reporting by Josh Dawsey and Laura Hughes in Pineville, N.C.