This story was originally posted at 11:45 p.m. Tuesday and has since been updated.

Democrat Conor Lamb declared victory as he clung to a slim lead over Republican Rick Saccone in the race for an open House seat in heavily conservative southwestern Pennsylvania early Wednesday morning, as the election’s results sent a chill down the spines of Republicans bracing for the 2018 midterms.

Lamb led Saccone by just 579 votes out of more than 220,000 cast with all precincts reporting shortly before midnight EST. The Associated Press has yet to call the race, as absentee ballots in some portions of the district have yet to be counted, and Saccone suggested he might be ready for a recount challenge.

After a series of close calls in GOP-leaning districts last year, Democrats may have flipped their first House district of the Trump era.

The essentially tied race comes in a district that President Donald Trump carried by 20 percentage points in 2016 and President Barack Obama lost by double-digit margins in both of his elections.

“It took a little longer than we thought, but we did it,” Lamb told his supporters around 1 a.m. EST.

That victory lap may be premature, but the huge shift in the district toward Democrats is the much bigger news than who wins the seat, especially after a series of huge gains in other special elections over the last year-plus.

While GOP strategists sought to spin the close race away, some admitted that Tuesday night’s results were alarming no matter which candidate prevailed.

“Regardless of who ultimately wins, this is not a good result for the GOP,” former Republican National Committee Communications Director Doug Heye tweeted. “Look for more retirements to come.”

Regardless of who ultimately wins, this is not a good result for the GOP. Look for more retirements to come.

Republicans have long argued that Saccone was a flop of a candidate, and they’re right, but that only partly explains of the election’s photo finish. Saccone struggled mightily with fundraising, had a highly antagonistic relationship with unions – a real problem in the labor-heavy district – and proved to be far less charismatic than Lamb, a fresh-faced former Marine. But Saccone was no Roy Moore, and in a normal political environment even a lackluster candidate should have been able to win with little problem.

Tuesday night’s result is the latest sign of a building Democratic wave, and suggests it may not be limited solely to suburban areas. While Pennsylvania’s 18th district contains a good chunk of better-educated Pittsburgh suburbs, much of it covers blue-collar and more exurban territory, it’s overwhelmingly white, and though it’s ancestrally Democratic, Republicans have won there for decades. The rural and poorer portions of the district did not shift as dramatically toward Lamb as the more educated areas, but he showed marked improvement compared to Hillary Clinton’s performance in the district in 2016.

If Democrats can keep fighting to a draw in districts like this, they can win in plenty of places where Republicans were all but guaranteed victories in past years, as there are 119 GOP-held House seats that are more Democratic than this one.

Lamb was a strong candidate with an impressive resume who helped himself by breaking with House Minority Leader Nancy Pelosi (D-CA). But Democrats won’t need the same type of lopsided edge in candidate quality to win in easier districts this fall, as evidenced by the more than three dozen state legislative seats they’ve flipped in the last year-plus, their upset win in Alabama’s Senate race, surprisingly strong margins of victory in gubernatorial wins in Virginia and New Jersey last year and an overall shift in most elections’ margins towards the party in House elections they’ve lost in red districts.

The Democratic Congressional Committee took a premature victory lap, congratulating Lamb on his “incredible victory” shortly before midnight.

But Saccone wasn’t ready to concede, telling supporters around the same time that “We’re going to fight all the way into the end.”

“This race is too close to call and we’re ready to ensure that every legal vote is counted. Once they are, we’re confident Rick Saccone will be the newest Republican member of Congress,” said National Republican Congressional Committee Communications Director Matt Gorman.

Republicans did all they could to stave off a loss in the district. President Trump visited twice, campaigning for Saccone as recently as Saturday, and a bevy of administration officials including Vice President Mike Pence and adviser Kellyanne Conway swung by to help him as well. The NRCC, the Congressional Leadership Fund super-PAC and other GOP groups combined to spend more than $10 million on the race. But their efforts appear to have fallen just short.

Compounding Republicans’ concerns: The CLF spent millions on TV ads to try to make Lamb pay for his opposition to the GOP tax overhaul, testing a line of attack they’d been planning to make a major part of their 2018 argument. Those ads didn’t seem to move the needle much, as the group moved onto more culture war-focused attacks in the race’s final two weeks as they looked to dent Lamb’s tough-on-crime reputation.

National Democrats largely worked to keep their help below the radar, with the exception of a visit from former Vice President Joe Biden.

The huge effort from both parties comes even though this district won’t exist after this year. The Pennsylvania Supreme Court has adopted a new congressional map for the November election, and Lamb is expected to run against Rep. Keith Rothfus (R-PA) in a new district that leans a bit Republican but not nearly as heavily as the one Lamb just won, while Saccone may run in a new more conservative district that overlaps with much of the current one. The deadline for filing for the 2018 fall elections is just a week away in Pennsylvania, so both candidates may have to file for the next race before they know for sure who will be heading to Congress for the next nine months.

Cameron Joseph
Cameron Joseph is Talking Points Memo's senior political correspondent based in Washington, D.C. He covers Capitol Hill, the White House and the permanent campaign. Previous publications include the New York Daily News, Mashable, The Hill and National Journal. He grew up near Chicago and is an irrationally passionate Cubs fan.