(CNN) In the 2016 presidential election Donald Trump defeated Hillary Clinton in the 18th Congressional District in southwestern Pennsylvania by 58%-38%, and rolled up a margin over his Democratic rival of more than 72,000 votes. That showing was one of Trump's strongest in a state that he only won by some 44,000 votes. Republican Rep. Tim Murphy, who represented the 18th, was reelected without opposition that year, just as he was in 2014.

But 16 months later, Democrat Conor Lamb has claimed victory and appears to have won a whisker-thin victory in special election to replace Murphy, who resigned after a personal scandal. CNN and other news organizations have not declared Lamb the winner, pending a complete tally of absentee, provisional and military ballots. Whatever the final outcome, the collapse of the Trump vote in a range of places, from well-heeled suburban enclaves around Pittsburgh, to working class townships, from exurbs to rural boroughs, should be a severe wake-up call for Republicans who must defend dozens of similar districts in the midterm elections just eight months from now.

And for Democrats fighting over the future of their party, it's a message that they can field moderate candidates who can win in Trump country if they can turn out the vote.

Margins and turnout in the suburbs

Obviously turnout in a special election is much lower, so these comparisons are not exact, but the numbers reflect a significance beyond turnout numbers.

The suburban townships of southern Allegheny County that made up roughly 45% of the total ballots cast in this special election (up from 42% in the 2016 presidential race) provided Lamb with his critical margin of victory. Clinton only won about 48% of the votes in this portion of the 18th in 2016, but Lamb captured 57% on Tuesday, eclipsing Saccone by more than 15,000 votes. Mt. Lebanon is the kind of white collar suburban town where Democrats are expected to do well these days: more than two-thirds of the adults have at least a four-year college degree and the median household income is $86,422 according to the latest census data. Indeed, Clinton carried Mt. Lebanon with 65% of the vote in 2016 and Lamb won a whopping 73%, a sign that Democratic voters are highly energized right now.

Bethel Park, less prosperous, but still well off, where less than half the adults are college grads, flipped from Trump, who won the township with 55% of the vote in 2016, to Lamb, who won 55% on Tuesday. Moon Township, where President Trump held a weekend pre-election rally for Saccone, also went for Lamb by seven percentage points. Trump carried it by 11 points. And one of the wealthiest towns in this part of Allegheny, Upper St. Clair, where the median household income clocks in at $110,417, which narrowly went for Trump over Clinton by about three percentage points, swung to Lamb who won it by 11 points.

Working class townships in Allegheny like Elizabeth and Whitehall also swung to the Democrats. Saccone, who represents Elizabeth in the state legislature, won the township by 19 percentage points on Tuesday. In 2016, Trump won it by 29 points. Whitehall, which was a draw between Trump and Clinton, went for Lamb by almost 21 percentage points.

Saccone won Washington County by some 3,400 votes, but that was a far short of the nearly 22,000-vote advantage that Trump harvested over Clinton. In Peters Township, a well-off, well-educated Pittsburgh exurb, Saccone defeated Lamb by a comfortable 59%-41%. But Trump bested Clinton, 67%-34%. Moreover, Saccone's margin over Lamb was roughly 1,500 votes while Trump swamped Clinton by more than 4,200. Saccone eked out a 150-vote win over Lamb in North Strabane, an adjacent Pittsburgh exurb, but Trump bested Clinton more than 1,800 votes in 2016.

In more downscale townships like Cecil and Chartiers, the Republican vote also eroded. Trump carried Cecil by almost 2,000 votes, besting Clinton by 29 percentage points. Saccone won Cecil by just over 200 votes, defeating Lamb by about five percentage points. And in blue-collar Chartiers, where Trump thumped Clinton by about 25 percentage points, Lamb edged out Saccone, 51%-49%.

Republican margins also tumbled in Westmoreland County portions of the 18th, the GOP stronghold in district. In 2016, Trump defeated Clinton by more than two-to-one here and amassed almost a 40,000-vote margin. In this special election, Saccone defeated Lamb 57%-42%, by a little more than 10,000 votes. (Westmoreland County had not reported precinct and township votes by the time this article was published.)

Even in the most rural part of the 18th Congressional District in Greene County, Democrat Lamb made inroads on Republican turf. Trump won this portion of 18th in 2016 by an overwhelming 72%-28% and more than 3,500 votes. Saccone only beat Lamb here by about 58%-41%, less than 800 votes, with handful of absentee ballots to be counted. In Franklin Township, where only 14% of the adults have a four-year college degree, Saccone won by roughly 15 percentage points and about 200 votes. In 2016, Trump defeated Clinton by 43 percentage points and about 1,000 votes. In tiny town of Perry, Saccone bested Lamb, 55%-44%, where Trump had crushed Clinton, 71%-29%. And in Waynesburg Borough, Lamb edged out Saccone 53%-47%, where Trump coasted by Clinton, 63%-37%.

Based on the results of this special congressional election, Republicans need to brace themselves for a Democratic wave that could swamp similar GOP congressional seats. Looking at the demographic and political characteristics of Pennsylvania 18, one can quickly identify GOP-held districts in danger like:

Illinois 14 (Northwestern Chicagoland: McHenry and Kane counties),

Iowa 3 (Southwest Iowa, Des Monies and Council Bluffs),

Michigan 3 (West-central Michigan, Grand Rapids metro),

Michigan 6 (Southwest Michigan, Kalamazoo),

Michigan 7 (Southern Michigan),

Michigan 8 (South-central Michigan, Detroit exurbs, Lansing),

Michigan 11 (Detroit suburbs in Southern Oakland and Western Wayne Counties),

Minnesota 2 (Twin Cities' South suburbs),

New Jersey 3 (South-central New Jersey),

New York 19 (central Hudson Valley, Catskills),

New York 22 (central New York, Utica, Binghamton),

Wisconsin 6 (East-central Wisconsin, Oshkosh, Sheboygan)

And in those 12 districts, Clinton won no more than 45% of the vote in 2016.

There are 23 additional GOP-held districts not on that list that Clinton won in '16. And there probably are another dozen or so Rustbelt districts similar to Pennsylvania 18 that could develop into competitive contests.

Candidates Count

Shortly before the election, Saccone complained that reporters had given Lamb favorable coverage while, "I have a big résumé that they try and scrunch down and don't say anything about."

Yet last Saturday, at a Pittsburgh airport rally for the GOP standard bearer, President Trump barely mentioned Saccone's name, let alone the record or policy stands of the four-term state legislator. Instead, Trump repeatedly asked an enthusiastic crowd to vote for Saccone because he was likely to support the President's agenda in Congress.

This pitch by Trump was consistent with the Republican strategy to nationalize the Pennsylvania special congressional election. The message was pretty simple: Saccone will back Trump, Lamb will be an ally of House Democratic Leader Nancy Pelosi who has been a useful GOP political foil in previous election cycles. Republican PACS spent heavily on campaign ads linking Lamb to Pelosi.

In a district that went for Trump by 20 percentage points over Hillary Clinton in 2016, this seemed like a logical approach to the race. Indeed, when Saccone was selected by a state GOP convention last November to be the party's nominee for the special election, he embraced this appeal, declaring, "I was Trump before Trump was Trump."

But this strategy relied on mobilizing the Trump base and relegated Saccone to almost a footnote in his own race. Perhaps in a stand-alone special election it's inevitable that Trump is going to be the overwhelming focus of the race. But the outcome in Pennsylvania suggests that Republicans who think they can mobilize the Trump base and ride out an impending Democratic wave next November could be making a bad political bet.

At the same time, Democrats were blessed in the 18th Congressional District by having Lamb as their nominee. There's no doubt that he was a superior candidate, well suited for his district, compared to the Democratic nominees of the four previous House special elections that the party lost. Making similar shrewd recruiting decisions will also be key to Democratic prospects come November.