Addressing supporters in Atlanta, Ms. Handel noted with pride that she had become the first Republican woman sent to Congress from Georgia, and she pledged to represent all of her constituents, including Mr. Ossoffs supporters. But she made clear that she would work to pass major elements of the Republican agenda, including health care and tax overhauls.
We have a lot work to do, Ms. Handel said. A lot of problems we need to solve.
For Democrats, the loss was demoralizing after questionable moral victories in two earlier special election defeats, for House seats in conservative districts in Kansas and Montana. Mr. Ossoff appeared so close to victory that Democrats were allowing themselves to imagine a win that would spur a wave of Republican retirements, a recruitment bonanza and a Democratic fund-raising windfall heading into the 2018 midterm elections.
Addressing a crush of cameras and supporters who spilled out of a hotel ballroom, a subdued Mr. Ossoff tried to strike a hopeful note as he conceded defeat.
This is not the outcome any of us were hoping for, he said. But this is the beginning of something much bigger than us.
The margin in Georgia was ultimately larger than even some Republicans had expected, with tax-averse voters in the outer suburbs overwhelmingly siding with Ms. Handel.
Yet the Republican triumph came only after an extraordinary financial intervention by conservative groups and by the partys leading figures, buoying Democrats hopes that they can still compete in the sort of wealthy, conservative-leaning districts they must pick up to recapture the House.
Both parties now confront the same question: What does such a hard-won victory in the Lululemon-and-loafers subdivisions of Dunwoody and Roswell, where Mr. Trump prevailed in November, augur for Republicans who next year will be defending an array of less conservative seats outside the South?
Even as Mr. Ossoff lost, Democrats spirits were somewhat lifted by the unexpectedly strong showing of their nominee in another special House election Tuesday, in South Carolina. In a heavily conservative district vacated by Mick Mulvaney now the director of the White House Office of Management and Budget African-Americans came out in force for a wealthy Democrat, Archie Parnell, and the Republican candidate, Ralph Norman, won by a narrower margin than Ms. Handel did in Georgia.
In the so-called jungle primary in Georgia the initial special election on April 18 Mr. Ossoff, one of 18 candidates on the ballot, captured just over 48 percent of the vote, an unusually strong showing for a Democrat but short of the 50 percent needed to avoid a runoff. Ms. Handel came in a distant second, with just under 20 percent, as Republicans divided their support among a number of credible conservative contenders.
But Republican leaders were optimistic that the partys voters would rally behind Ms. Handel in a two-candidate showdown.
Questions also lingered about whether the grass-roots coalition backing Mr. Ossoff fueled by highly motivated anti-Trump activists who were, in many cases, new to political activity and organizing could improve on its April showing in a runoff held at the beginning of the summer vacation season, in a district where people have the means to escape to the beach.
Karen Handel, a Republican, won a U.S. House seat in Georgia. Its a reprieve for President Trump and a demoralizing blow to Democrats.
Ms. Handel and her supporters portrayed Mr. Ossoff as far too liberal for a district that, covering somewhat different territory, was represented from 1979 to 1999 by Newt Gingrich, a Republican and former House speaker. They also criticized Mr. Ossoff for his youth and inexperience and assailed him for living outside the district, although he was raised in it.
Mr. Ossoffs allies, for their part, paid for an advertising campaign deriding Ms. Handel, a former chairwoman of the Fulton County Board of Commissioners, as a profligate spender while in office. And Mr. Ossoff ran television ads that rehashed Ms. Handels resignation from the Susan G. Komen Foundation over her belief that the group, which raises money to fight breast cancer, should cut ties with Planned Parenthood.
While Mr. Ossoffs supporters showed great passion, Republicans were presumed to have a heavy mathematical advantage in the district, which Tom Price, now Mr. Trumps health secretary, won by 23 points in 2016. And it was unclear throughout the contest how the two campaigns would ultimately be buffeted by tempestuous events in Washington, including Mr. Trumps handling of the investigation into Russian meddling in the presidential election, the Houses passage of an unpopular health care overhaul bill, and the attack last week on a group of Republican lawmakers by an anti-Trump liberal.
Republicans, fearing the symbolic and tangible repercussions of a loss in Georgia, spared no expense in propping up Ms. Handels candidacy. Mr. Trump, Vice President Mike Pence and House Speaker Paul D. Ryan all came to Atlanta to help her raise money, and conservative groups poured $12 million into the runoff, nearly all of it assailing Mr. Ossoff.
A super PAC aligned with Mr. Ryan, the Congressional Leadership Fund, spent more than $7 million from April to June.
Still, the $8 million gusher of liberal money that Mr. Ossoff enjoyed leading up to the April vote only intensified during the two-month approach to the runoff. He brought in another $15 million, much of it in small contributions from beyond Georgias borders. And national Democratic groups, persuaded that he had a strong shot at winning, rushed in with their own advertisements denouncing Ms. Handel.
Although they received enormous political and financial support from allies in Washington, the two candidates tiptoed around more polarizing national political figures. Ms. Handel rarely uttered Mr. Trumps name of her own volition, preferring instead to highlight the districts Republican lineage and warn that Mr. Ossoff would do Ms. Pelosis bidding. Only in declaring victory late Tuesday night did Ms. Handel make a point of offering special thanks to the president of the United States of America, a line that set off a boisterous chant of Mr. Trumps name by the crowd.
Mr. Ossoff, for his part, sought to avoid being linked to Ms. Pelosi or labeled a liberal. He assured voters he would not raise taxes on the rich. And in pledging to root out wasteful spending and seek compromise, he sounded more like an heir to former Senator Sam Nunns brand of Southern centrism than a progressive millennial who cut his teeth working for Representative Hank Johnson, a DeKalb County liberal.
Voter turnout in April was already high for a spring special election, and it soared during the runoff, to more than 240,000, from more than 190,000. Nearly 150,000 voters cast ballots before the polls opened on Tuesday, nearly three times the early vote in the first round. And nearly 40,000 of those people had not voted at all in April.
By Tuesday, the fatigue among voters was palpable.
Some residents posted warnings demanding that campaign workers stop knocking on their doors.
NO SOLICITATION!!!!!!! read one sign, photographed and published on social media by a Handel supporter. And no! We arent voting for OSSOFF! I have big dogs!!!
The campaign so enveloped the Atlanta region that polling places in a neighboring district posted signs telling residents that they were not eligible to vote.
Alan Blinder and Emily Cochrane contributed reporting.
Get politics and Washington news updates via Facebook, Twitter and in the Morning Briefing newsletter.
A version of this article appears in print on June 21, 2017, on Page A1 of the New York edition with the headline: Republican Wins A Race in Georgia Drenched by Cash.
More:
Karen Handel Wins Georgia Special Election, Fending Off Upstart Democrat - New York Times