Republicans have emerged from two close-call elections rattled but not — yet — defeated, but with fresh, frightening evidence of the additional political peril that almost certainly lies ahead.

Sure, they avoided the calamity of an outright loss in Tuesday’s special election in Georgia, advancing to a runoff race in two months to replace the new health secretary, Tom Price. And when lawmakers return next week, House Speaker Paul D. Ryan’s first order of business will be to swear in the newest House Republican, Ron Estes, after his special election win in Kansas last week.

But both races gave Republicans a scare they never would have anticipated six months ago — and demonstrated that Democrats have galvanized the anti-Trump activism of the past three months into votes at the ballot box. Even though Democrats came up short in each race, these were seats way down the list of top Democratic targets. This was particularly true of the Estes race, in a district where Trump won by an overwhelming margin.

Far richer targets await in the 2018 midterm elections.

[Republicans avoid big loss by forcing runoff in Ga. House race]

(Bastien Inzaurralde/The Washington Post)

And in the near term, Republicans find themselves facing the same task — figuring out how to fulfill President Trump’s agenda — that rallied Democrats in the first place.

Democrats believe that Jon Ossoff’s performance, less than two points shy of the 50 percent threshold he needed to win outright, validated their emerging strategy of focusing on dozens of GOP seats in diverse, well-educated suburbs across the country in advance of next year’s elections. Price regularly won this seat north of Atlanta without breaking a sweat, but Trump won the region by just 1.5 percentage points last year.

[For Republicans in Georgia’s 6th District, a delicate dance with Trump]

That signaled a potential vulnerability for several dozen Republicans in similar suburban areas, many of whom, like Price, have regularly won reelection by wide margins. Almost all of these Republicans have never run for Congress with a Republican president in office.

They are Republicans such as Reps. Lee Zeldin from Long Island and Ryan Costello from Philadelphia’s western suburbs, both elected in 2014, and Reps. Erik Paulsen from the Twin Cities suburbs and Leonard Lance of New Jersey, both elected in 2008. All four won reelection last November in a rout, with Lance’s 11-percentage-point win being the smallest margin of the four.

Now they are all Democratic targets next year because of the suburban makeup of their districts. Previously they ran as independent checks against a Democratic president whose popularity wavered in those regions, but now they must choose sides — defend or distance themselves from Trump.

“Even if he doesn’t hit 50 tonight, Ossoff is showing us the path to retaking the House. It runs through the Panera Breads of America,” Brian Fallon, a former adviser to Hillary Clinton’s presidential campaign and Senate Minority Leader Charles E. Schumer (D-N.Y.), wrote Tuesday on Twitter.

Democrats need a net gain of 24 seats to reclaim the House majority, and Ossoff’s strong showing will heighten the attention on every decision made by Republicans in potential swing districts over the next 18 months.

House Republicans have already backed off one attempt to pass Ryan’s plan to revise the 2010 Affordable Care Act, because of a revolt from conservatives and moderates. The House is midway through an 18-day break in which some Republicans have faced angry voters at town halls complaining that Ryan’s health-care plan would leave millions uninsured.

Trump has been pushing for more negotiating and for a vote later this spring. The task was already an uphill fight. Now, after Kansas and Georgia, House Republicans may be even more anxious about voting on the controversial plan.

If Republicans start believing their majority is imperiled, everything will grow more difficult. Each vote could bring more doubt from rank-and-file lawmakers wondering whether they are walking a plank toward defeat in the midterms.

Legislative paralysis, in turn, could imperil Republican fortunes even more.

Trump came into office with a sweeping prediction that he would win so much that the public would get tired of winning. Ryan spent last year waving his “Better Way” policy prescriptions, which he promised would become a reality under a Republican Congress and president.

If Republicans don’t push through some parts of Trump’s agenda, they’ll have very little to show voters next year in their reelection bids.

This is a new dilemma for Republicans. Since winning the House during the 2010 midterms, they have behaved as if their gerrymandered districts created a permanent majority. They pushed the U.S. treasury to the brink of default in 2011 yet lost only a few seats the following year; they forced a government shutdown in 2013, only to expand their majority in 2014 to its largest since the Great Depression.

Fast-forward to this year, when, in the span of one week, Republicans needed a last-minute infusion of cash from conservative groups in Washington to prop up Estes and saw a nearly $5 million barrage of ads against Ossoff do nothing more than keep him from winning outright in a district that has been held by Republicans since 1979. Those GOP groups will probably spend that much and more between now and the June 20 runoff.

Ali Lapp, president of a Democratic super PAC, the House Majority PAC, questioned whether, by the fall of 2018, the GOP would be “prepared to spend that much money in all districts this Republican.”

Ossoff’s fate may not be the best determinant of whether they need to. Even if he loses in June, it might be a false positive.

That’s what happened in June 2006, when Republicans poured all their resources into narrowly winning a special election to replace the imprisoned Randy “Duke” Cunningham. Democrats did the same in May 2010, eking out a win in a special election to replace the late John P. Murtha in western Pennsylvania.

In each instance, the majority party claimed that the race showed they were well positioned for the midterm elections. In each instance, they were wrong: Democrats proceeded to lose the majority in 2010, and Republicans lost in 2006.

The reality was that those special elections demonstrated only that the party in power had the wherewithal to win in a single head-to-head contest. When the general elections arrived, one side was trying to defend 60 or more vulnerable seats, while the minority had only a few at-risk districts to protect.

Now, Republicans have to decide whether to keep pushing the big and bold plans on health care and an overhaul of the tax code — or whether to pull back the ambition in the hope for some narrower victories.

Each path has its own level of vulnerability, as two straight close special elections have demonstrated.

Read more from Paul Kane’s archive, follow him on Twitter or subscribe to his updates on Facebook.