Wednesday was a very good day for Democrats and a catastrophic day for Republicans, as Democrat Conor Lamb narrowly edged out a win over Republican Rick Saccone in Pennsylvania’s 18th Congressional District.

The race stretched into Wednesday midday when CNN said Lamb was in the lead by 627 votes with 100 percent of precincts reporting. State law does not mandate a recount in district-level elections. Unless Republicans can successfully challenge him, that means Lamb just pulled off a stunning upset in a district Democrats hadn’t won in more than 10 years.

Lamb declared victory early Wednesday morning, and was introduced as as “congressman-elect” to his crowd of supporters as he took the stage.

“It took a little longer than we thought, but we did it!” he told them.

Lamb’s win has seismic political implications for 2018 and changes what Democrats thought was possible going into a crucial election year. It also says a lot about what messages will and won’t resonate with voters in so-called “Trump country” districts.

Winner: Democratic enthusiasm

Pennsylvania’s 18th Congressional District is a huge win for Democrats. They weren’t just reclaiming territory they had lost to Trump; they were able to push into solidly red territory that Republicans had held since 2003. It’s a continuation of the momentum they’ve been building on in special elections throughout 2017, most notably with Sen. Doug Jones winning the special Senate race in Alabama — the first Democrat to do so in 25 years.

Just like with Alabama, it’s worth reminding people that Democrats didn’t even think they could compete in this Pennsylvania district a few months ago. But they had the right candidate in Lamb, a 33-year-old veteran and federal prosecutor.

The district has Democratic roots; there are technically 70,000 more registered Democrats in the 18th Congressional District than Republicans, but many of those voters have been casting ballots for GOP candidates for years. It’s probably more accurate to think of it as an economic populist district rather than strongly conservative.

It’s also heavy union territory (a huge demographic for Donald Trump in 2016). Lamb was able to strike the right balance with pro-gun views and moderate messaging on abortion. He is very pro-union, while his Republican opponent Rick Saccone was vehemently anti-union.

Since Trump trounced Hillary Clinton in Rust Belt states like Pennsylvania, Wisconsin, and Michigan in 2016, he was able to spin the narrative that the Rust Belt was “Trump country.” But Lamb’s victory turns that on its head. Lamb didn’t make the race about Trump, but he actually ran on many of the same issues Trump did: preserving Medicare and Social Security, fighting the opioid crisis, and protecting pensions for the area’s coal miners.

Especially as Trump’s administration breaks with many of his 2016 campaign promises (proposing vast cuts to Medicare and doing little to solve America’s drug problem), Democrats will try to replicate Lamb’s playbook to pick up more Rust Belt districts during the 2018 midterms.

Winner: pro-gun Democrats

Lamb portrayed himself as an independent, moderate Democrat from the beginning, including on the gun issue. In fact, his first campaign ad featured footage of him shooting an AR-15 semiautomatic rifle at a gun range, with the narrator voiceover saying the candidate “still loves to shoot.”

Throughout the campaign, Republicans tried furiously to attack Lamb on the gun issue, painting him as a candidate who would pursue aggressive gun control policies as soon as he got to Washington. But that goes against what Lamb was actually saying. A US Marine Corps veteran, he supports improving the existing background check system but is on the record as not supporting new gun control measures.

But that’s putting the Democratic Party in a tricky position amid a fresh wave of anti-gun activism led by student survivors of the Parkland, Florida, shooting last month. On Wednesday, thousands of high school students staged nationwide walkouts and protests demanding Congress pass new gun control laws to stop mass shootings. Many Democratic members of Congress joined them in a show of solidarity.

As Democrats try to win back the House in 2018, they’re going to need candidates like Lamb in the mix. More Democratic 2018 candidates are explicitly campaigning on gun control as an issue they believe can win them elections. Lamb’s win could change that calculus in redder districts.

The big picture is that if Democrats can pull off a decisive win in 2018 and take back congressional majorities, they could be in a position to vote on gun legislation — whether it’s strengthening background checks or calling for a full-on assault weapons ban. Who makes up the caucus will determine what kind of legislation gets voted on.

Winner: Pennsylvania redistricting

With the amount of national attention and money thrown into this race, it was easy to forget that we all get to do this again in November ... by which time PA-18 will be a completely different district.

That’s because a few weeks ago, Pennsylvania’s Supreme Court ruled that the state’s congressional map, which Republicans drew in 2010, was unconstitutionally partisan. After some back-and-forth between the Republican-controlled state legislature and Democratic Gov. Tom Wolf, the duty to redraw the maps was kicked back to the state Supreme Court, which released a new map a few weeks ago.

Here’s the old map. PA-18 is the district in the bottom left-hand corner.

And here’s the new map. If you notice, PA-18 and PA-14 have essentially switched places (among other changes). The biggest change is that PA-18 will contain much more of liberal Pittsburgh and less of the conservative counties that kept the district under Republican representation for 15 years. It will go from being a Republican stronghold (that a Democrat just won) to a swing district.

The new map has cleaner lines, splits fewer counties, and will likely lead to many more competitive elections. This is certainly better for Democrats, but due to the degree the state was gerrymandered to benefit Republicans, it’s more accurate to think of this redrawing as leveling out the balance rather than a Democratic gerrymander.

The 18th District was drawn to keep a Democrat from winning it, but Lamb did it anyway. Pennsylvania Republicans are challenging the new map. But if it stays, Lamb likely will breeze through his November race with a much more favorable district.

Loser: President Donald Trump

Trump really, really cared about Republicans winning PA-18, which was supposed to be solid “Trump country.” (He won it by 20 points in 2016.) And Saccone tried to style himself as a Trump-like candidate, declaring himself “Trump before Trump was Trump.”

Trump cared enough about Saccone getting the seat that he joined the Republican candidate on the campaign trail multiple times, as well as sending Vice President Mike Pence and members of his family. Donald Trump Jr. and Ivanka Trump both stumped for Saccone around the district. Trump even pushed a controversial announcement on steel and aluminum import tariffs to land a week before the special election. (Polling by Monmouth University found tariffs barely registered before election day.)

Republicans and conservative groups poured a deluge of cash into the PA-18 race so they wouldn’t embarrass themselves by losing a district they had hung on to easily for more than a decade. But for Trump, the impetus was much more personal.

Trump’s push wasn’t about Saccone, it was about hanging on to “Trump country” in southwestern Pennsylvania — and with it, the very narrative about Rust Belt voters that put him in the White House. Lamb’s win was a huge blow to that narrative and likely, for a president who cares so much about loyalty, to Trump’s pride as well.

Loser: GOP tax cuts (reform)

Congressional Republicans insisted their tax cuts would help them win elections. That didn’t pan out in PA-18, a working-class district that should have been the model for tax cut success.

At first, Republicans went all in on their tax cut messaging. For weeks, the bill was the subject of countless ads and consumed Saccone’s talking points on the trail. Trump even came to the state for a conveniently located GOP tax rally in western Pennsylvania in January, which the White House insisted was not directly related to Saccone’s candidacy.

That didn’t last, but it’s not necessarily because the tax bill is unpopular — it’s more that there are just too many other things going on and it’s tough for voters to stay focused. Since Republican passed the tax bill in December, it has generally grown in popularity — but in Pennsylvania, it wasn’t enough to secure Saccone a stable lead in the polls.

At the beginning of February, almost two-thirds of GOP ads were about the Republican tax law, according to a Politico analysis. By election day, the same groups had pivoted sharply to decrying so-called sanctuary cities, as Politico reported:

Since the beginning of March, tax ads have been essentially non-existent. Only two are on the air now — one from the pro-Trump super PAC America First Action which briefly mentions the tax law, and a radio ad from a progressive group attacking Saccone for supporting the law.

That doesn’t mean Republicans are going to stop messaging on taxes for the 2018 midterms. They were all but doubling down during a GOP press conference on Capitol Hill Wednesday.

.@cathymcmorris starts off the GOP press conference today with a comment on Pennsylvania: says it’s important not to make “sweeping predictions” and that we’re “not even in full momentum on tax reform” — Tara Golshan (@taragolshan) March 14, 2018

Loser: egregious campaign spending

Imagine you had $7 million. Now imagine taking a match and lighting that $7 million on fire. That’s essentially what Republicans did in PA-18.

Republicans and conservative-allied groups heavily outspent the Democrats throughout the race, even though Lamb outraised Saccone by a substantial amount. After Saccone’s campaign showed a lackluster fundraising effort, outside Republican groups — including the national campaign arm for House Republicans — jumped in to get Saccone over the finish line.

According to the Washington Post, as of February 27, Saccone’s campaign and allied groups had spent a total of $9.1 million on the race, between the Congressional Leadership Fund, the National Republican Congressional Committee, and others. Meanwhile, Democratic groups and labor unions had spent less than $1 million.

The official campaign arm for House Republicans reported spending another $619,664 on media ahead of the March 13 election for Pennsylvania’s 18th District House seat, bringing the total to $3.5 million on media buys as of last week in a last-minute panic.

And even if Republicans had been successful in this last-minute cash push, it’s important to remember that the winner will hold on to the seat for less than a year and the race’s outcome didn’t determine the control the House of Representatives. The sheer amount of spending was largely pointless.

Given that they weren’t successful, the GOP may be forced to reconsider its messaging and recruitment. Clearly, money didn’t get them very far in this race.