Bishop defeated opponent Dan McCready by 3,937 votes after the RNC made a concerted effort to target Democratic-leaning Trump supporters in two counties. Those included Democratic-leaning Cumberland County, where McCready won by four points in 2018, and where the president held his rally

Bishop secured Election Day voters in Cumberland despite losing absentee and early votes for the county. And while McCready won neighboring Robeson County by 15 points in 2018, Bishop was able to close that gap substantially on Tuesday.

The special election, viewed by some political observers as a bellwether for the president and his 2020 reelection prospects, came after reported voting irregularities in 2018 that eventually prompted a do-over.

RNC Chief of Staff Richard Walters attributed the win to Trump and the party’s infrastructure. “Thanks to the best closer in the business, President Trump, and Chairwoman [Ronna] McDaniel’s steadfast commitment to investing in our permanent data and ground-game infrastructure, we knew we had the recipe to put Dan Bishop over the top,” he said.

“Our data told us how many voter contacts needed to be made and helped the president make an informed decision about where he should hold his rally. This winning formula will be key for President Trump and Republicans in 2020.”

National party committees poured $5.8 million into the race, helping Bishop, who had only spent $1.9 million, match the total from Democrats and McCready of roughly $6.1 million.

Both the president’s rally and the RNC’s spending helped Bishop edge out his victory, according to the Democratic Congressional Campaign Committee (DCCC). “We fell an inch short tonight, but it took more than $6 million in outside Republican spending and a last-minute Trump rally,” DCCC Chairwoman Cheri Bustos said.