Republican Karen Handel staved off a furious challenge from Democrat Jon Ossoff on Tuesday in a race to represent a suburban Atlanta seat in Congress, as the GOP and President Donald Trump avoided an embarrassing defeat in the most expensive U.S. House contest in history.

A former Georgia secretary of state, Handel emphasized her experience and roots in Georgia's 6th Congressional District to defeat Ossoff and keep a seat that's long been held by Republicans in GOP hands. She becomes Georgia's first female Republican member of the U.S. House.

Her victory will be cast as a win for Trump, who campaigned for Handel and hurled a string of antagonizing tweets at Ossoff. And it could buoy jittery GOP incumbents who worry that allying with Trump in competitive districts could doom them.

She overcame stiff opposition from Ossoff, a 30-year-old investigative filmmaker who fast became a rising Democratic star. With a carefully calibrated message, Ossoff shattered fundraising records as he appealed to liberals infuriated by Trump and GOP voters frustrated at Washington gridlock.

Georgia District 6 Runoff: Republican candidate for the 6th district Karen Handel (Video by Armani Martin)

His huge fundraising hauls – he raised at least $23 million – kept his message on metro Atlanta’s airwaves and allowed him to target irregular voters and others who rarely cast ballots for Democrats. And a legion of more than 12,000 Ossoff volunteers inundated the district with appeals to vote. But in the end, the money and Democratic energy wasn’t enough to overcome the district’s Republican underpinning.

Once a fervent anti-establishment candidate, Handel ran in this contest as a traditional conservative voice who backed Trump and his top priorities while saying she won’t be an “extension” of the White House.

She also relentlessly attacked Ossoff as an inexperienced stooge of national Democrats funded by out-of-state interlopers. At every turn, she sought to remind voters that Ossoff lived outside the district and that his values were “3,000 miles away.”

Handel won the conservative-leaning district, which stretches from the outskirts of Marietta to north DeKalb County, by running up big margins in GOP strongholds in places such as east Cobb County and Milton where Republicans have long thrived.

She also was able to overcome concerns with Trump across the territory. The president only narrowly carried the district in November, and polls showed him with weak approval ratings. But after keeping him at arm’s length early in the race, she aggressively embraced him after she landed a spot in the runoff in April.

The race - which cost more than $50 million – was over little more than a short-term lease to fill the remainder of former U.S. Rep. Tom Price’s term. She’s likely to face another tough Democratic challenger in November 2018, although Ossoff has said he hasn’t yet decided whether he’ll run again.