WASHINGTON — A special election that went down to the wire in Southwestern Pennsylvania on Tuesday night left both parties in suspense — but still pointed to GOP political peril.

The fact that Democrat Conor Lamb even came close in a House district that President Trump won by nearly 20 percentage points in 2016 provided another daunting data point for Republican incumbents wondering if they might be better off retiring, including those in tougher Pennsylvania districts.

Republican State Rep. Rick Saccone might win — he and Lamb were in a virtual tie near midnight Tuesday, with the outcome possibly hinging on absentee ballots — but even if he does, Democrats had far outperformed their historical expectations, pointing to a potential surge in congressional elections this fall.

The race "should not be close unless the GOP is screwed in the midterms," conservative writer Erick Erickson tweeted.

Still, a GOP win would spare Republicans — and deprive Democrats — of the clean emotional hit of a decisive night for Lamb, and offer Trump a chance to boast that his late rally helped seal a victory.

The tight outcome came despite an intense GOP effort — and millions of dollars in outside spending — to promote the tax cuts that Republicans hope can save them at the polls in November.

It came in a district filled with the white working-class voters who have underpinned the president's support, and who powered his stunning victory in 2016. And it came despite a late visit by Trump for Saccone, who had vowed to back the president, hoping to ride his base to victory.

The results suggest that if the GOP can't win there, the party could face a bigger wipe-out.

Jesse Ferguson, a Democratic operative, tweeted that 118 Republicans sit in House districts where Trump won by smaller margins than he did in this one. Among them are Rep. Ryan Costello of Chester County, whose district Trump lost two years ago and is likely to grow more Democratic in a new congressional map.

Here are some takeaways from what most analysts said should have been an easy GOP win Tuesday night:

• Trump's short coattails. As he did in a special Senate election last year in Alabama, the president went big for a struggling GOP candidate. But he and his supporters came up against a Democratic surge and rejection — or indifference — from voters who backed the president before.

As they did in Alabama, Republicans blamed a weak candidate, Saccone. Democrats said the results — like others in the last year — show people souring on the president.

"Win, lose, or draw, the message is, Republicans are in trouble," Rep. Steny Hoyer of Maryland, the second-ranking House Democrat, said Tuesday morning. Democrats, he said, "shouldn't even be playing" in a district so conservative.

In a district that encompasses some Pittsburgh suburbs and a rural swath that borders West Virginia, GOP groups spent more than $10 million to hold a seat for just nine months, knowing that a loss could echo.

A Monmouth University poll of likely voters there this month found roughly equal numbers approved and disapproved of Trump's performance — despite his romp there 16 months ago.

"Republicans have to look at why was this race even this close out of the gate," said Larry Ceisler, a Philadelphia-based Democratic consultant who grew up in Washington County, which makes up part of the district.

Trump, with an eye on the Rust Belt area so important to him as a point of personal pride and political strength, even reportedly announced his tariff on steel and aluminum imports to help swing this race.

Elsewhere in Pennsylvania, Rep. Lou Barletta has also hitched his Senate campaign this year to Trump's agenda. That strategy wasn't a clear winner for Saccone, and other Republicans may start looking for ways to distinguish themselves from the president.

• Tax plan. Republicans have been hoping that Trump's tax cuts would help douse liberal fire this year. But that bet went sideways in this race. After Republican groups bombarded the airwaves attacking Lamb for opposing the tax plan, those ads all but disappeared in the race's final days, Politico reported. A liberal group, meanwhile, ran a spot attacking Saccone for supporting the cuts.

• Dem blueprint. Lamb ran as a different kind of Democrat in a district his party had long abandoned. He opposed some of the toughest proposed gun laws, denounced his party's House leader, Nancy Pelosi, and said he opposes abortion but wouldn't legislate against it.

He did not directly attack Trump. Instead, he promoted his time as a Marine and federal prosecutor, and emphasized working-class issues.

"Conor Lamb was the absolute right candidate," former Pennsylvania Sen. Rick Santorum, a Republican, said on CNN Tuesday night. "If you run a traditional Democrat in that district … it's not close." The district has more registered Democrats than Republicans, but the GOP has dominated House races there.

Lamb's approach might not work in the moderate suburban districts where Democrats hope to make their biggest gains — including in Delaware and Chester Counties and South Jersey — but it may provide a blueprint where Democrats have long lost ground.

• Lamb's future. If he wins, Lamb won't have much time to celebrate: He immediately faces another tough race for a full term in November. And possibly on new turf.

Under the new congressional map drawn by the Pennsylvania Supreme Court, Lamb's home will be in a different district — one more friendly to Democrats but also home to a tougher Republican, Rep. Keith Rothfus.

Saccone said he would also run in November no matter what. He plans to campaign in a reconfigured district that is even more conservative than the current one. But Republicans who bashed his campaign may look for other options.