Republican candidate Ron Estes is projected to win a Kansas House seat, overcoming an unexpectedly tough challenge and denying Democrats a major upset — albeit by a much slimmer margin than his Republican predecessor.

Estes defeated civil rights attorney James Thompson (D) in Tuesday’s special election to fill the seat vacated by CIA Director Mike Pompeo, with both The Associated Press and The New York Times calling the race.

With 100 percent of precincts reporting, Estes has 53 percent of the vote in Kansas's 4th Congressional District to Thompson's 46 percent.

ADVERTISEMENT

Estes, a two-term state treasurer, had been expected to cruise to the finish line in a district that Trump carried by nearly 30 points. In the final days of the race, however, Republicans scrambled to fend off what would have been a devastating upset.

The National Republican Congressional Committee poured in last-minute resources, spending nearly $100,000 on ads that called Thompson “too extreme for Kansas” and accused him of supporting “late-term abortions.” Thompson’s campaign called the ad false and asked for it to be pulled.

Trump also threw his considerable weight into the race, recording a robocall and tweeting his support for Estes on Tuesday. Vice President Pence also recorded a robocall, while Sen. Ted Cruz Rafael (Ted) Edward CruzLoeffler calls for hearing in wake of Netflix's 'Cuties' Health care in the crosshairs with new Trump Supreme Court list 'Parks and Rec' cast members hosting special reunion to raise money for Wisconsin Democrats MORE (R-Texas), who won the 2016 Kansas GOP presidential caucuses, campaigned for Estes.

Even national Democrats got involved a day before the race, with the Democratic Congressional Campaign Committee doing 25,000 live calls in the final two days to support Thompson.

Thompson, who won the endorsement of Our Revolution, a group aligned with Sen. Bernie Sanders Bernie SandersSenate Republicans signal openness to working with Biden Hillicon Valley: DOJ indicts Chinese, Malaysian hackers accused of targeting over 100 organizations | GOP senators raise concerns over Oracle-TikTok deal | QAnon awareness jumps in new poll Schumer, Sanders call for Senate panel to address election security MORE (I-Vt.), repeatedly tied Estes to Kansas Gov. Sam Brownback (R), who was ranked the most unpopular governor in the country in a poll from late last year.

Democrats’ defeat in Kansas likely deals a blow to their momentum going into next week’s nationally watched Georgia special election, although the national party had been reluctant to invest in the Kansas race.

In Georgia, Democrat Jon Ossoff is looking to win outright in the April 18 “jungle primary” and pull off a huge upset in the conservative suburban Atlanta district that Trump only carried by 1 point. The vacant seat in Georgia's 6th Congressional District was previously held by Health and Human Services Secretary Tom Price.

Estes will have to run for a full two-year term in 2018.

Last updated at 6:14 a.m.