SANDY SPRINGS, Georgia — Republican Karen Handel won the special congressional election in Georgia on Tuesday, fending off a challenge from Democrat Jon Ossoff in the heavily Republican House district.

Handel’s victory in the closely fought contest, which drew national interest and was the most expensive House race ever at over $50 million spent by both sides, comes as good news for President Donald Trump. Democrats had promoted the contest as a referendum on the president.

With 99 percent of the vote counted, Handel leads Ossoff 53 percent to 47 percent in a race that many expected to be much closer. Handel had 127,021 votes to the Democrat's 114,390 ballots.

In her victory speech, Handel offered “a special thanks to the President of United States of America,” as the crowd began chanting Trump’s name.

Trump had earlier tweeted his congratulations to Handel, who fills the seat vacated by Tom Price, who joined the president's Cabinet as Health and Human Services secretary.

Congratulations to Karen Handel on her big win in Georgia 6th. Fantastic job, we are all very proud of you! — Donald J. Trump (@realDonaldTrump) June 21, 2017

Thank you @FoxNews "Huge win for President Trump and GOP in Georgia Congressional Special Election." — Donald J. Trump (@realDonaldTrump) June 21, 2017

Handel also drew cheers for declaring, "We need to finish the drill on health care."

"Democrats from coast to coast threw everything they had at this race, and Karen would not be defeated," said House Speaker Paul Ryan.

Once the outcome was clear, Ossoff took the stage to announce he had called Handel to concede — drawing boos from the crowd.

Ossoff said this "small community here in Georgia, which has become the epicenter of politics — sometimes to my chagrin,” had sent a message.

"As darkness has crept across this planet, (you) have provided a beacon of hope for people here in Georgia and people around the world,” Ossoff told his supporters. "We showed the world that in places where no one thought it was even possible to fight, we could fight.”

Defeated Democratic candidate Jon Ossoff on Tuesday night. Erik S. Lesser / EPA

Democrats may try to call the outcome a moral victory, but it doesn’t change the fact that they’re 0-4 for congressional races this year, even after spending millions of dollars and whipping up a hyper-motivated base.

"Race better be a wake up call for Democrats — business as usual isn't working," tweeted Rep. Seth Moulton (D-MA). "Time to stop rehashing 2016 and talk about the future."

Rarely, if ever, has a single congressional race attracted this much attention or been freighted with so much meaning.

Under the gaze of the national and even international press, voters cast ballots in Georgia that they knew would be interpreted as a referendum on Trump, the GOP healthcare plan winding its way through Congress, and much more.

With more than $50 million in spending, the race easily shattered the record for the most expensive House race — by more than $20 million — as money flowed in from around the country. Final spending numbers are likely to be even higher once the full data is released.

Republican congressional candidate Karen Handel participates in a 'Get Out The Vote' rally at a restaurant in Marietta, Georgia. Erik S. Lesser / EPA file

The candidates and their surrogates professed the race was being misread by national pundits.

“They have tried to make this a national election, but it is a local election,” said Republican Jere Wood, the mayor of Roswell, Handel’s home town.

But despite the adage about all politics being local, national issues clearly motivated voters here — just as they do everywhere at a moment of intense polarization and political engagement.

Handel and tens of millions of dollars in ads from GOP super PACs called Ossoff an inexperienced liberal who had more in common with California than Georgia. Ossoff, meanwhile, promised supporters a chance to “make Trump furious” and “send a message that will be heard across the country and around the world.”

Trump repeatedly weighed in on the race, using Twitter earlier on Tuesday to warn voters that Ossoff "wants to raise your taxes to the highest level and is weak on crime and security."

On Tuesday night, top Trump adviser Kellyanne Conway tweeted that, in fact, the outcome was a referendum on the president.

Thanks to everyone who breathlessly and snarkily proclaimed #GA06 as a "referendum on POTUS @realDonaldTrump".



You were right. #winning — Kellyanne Conway (@KellyannePolls) June 21, 2017

Tuesday morning, Handel appeared at her polling place to mock Ossoff for not even living in the district, and she noted he couldn't vote for himself on Election Day. Ossoff was raised here, but currently lives a few miles away so his fiance can be closer to the medical school she attends.

Ossoff spent the day crisscrossing the district to visit polling places and give pep talks to volunteers.

From day one, Ossoff had a very narrow target to hit while Handel had more room for error in this longtime GOP stronghold.

He had to hunt for every Democratic vote in these wealthy suburbs once represented by Newt Gingrich, and needed to pick off some Republicans and Independents to boot.

Handel, meanwhile, just needed to bring home a respectable number of people who spent years voting for Mitt Romney, John McCain and the dozens of other GOP candidates before Trump came along.

As skeptical as these generally well-educated Republicans have been about Trump, many were even more reticent to vote for a Democrat — even one who presents as moderately and even-tempered as Ossoff.

Meanwhile, in South Carolina, a special congressional that did not attract nearly as much attention, finished closer than expected. Republican Ralph Norman defeated Democrat Archie Parnell by fewer than 5 percentage points with over 90 percent of the vote counted.