Republican groups essentially lit more than $7 million on fire in Pennsylvania.

In a race that’s still undecided, GOP candidate Rick Saccone fell short in the Pennsylvania House special election, in a district that President Donald Trump won by 20 points.

Saccone, a state legislator who called himself “Trump before Trump was Trump,” is behind Democrat Conor Lamb, a 33-year-old attorney and former Marine, in a special election to replace former Republican Rep. Tim Murphy, who resigned last year after reports revealed he had asked a woman he was having an affair with to have an abortion. Lamb has declared victory, but Saccone has yet to concede.

Regardless of outcome, after an extensive and heavy-handed media campaign, the results may force the GOP to reconsider its messaging and recruitment. Clearly, money didn’t get them very far.

The history and demographics of Pennsylvania’s 18th Congressional District, which covers the southwest corner of the state, should have made for an easy race for Saccone; the region is older and very white (total minority population is less than 5 percent), and was rated as an R+11 district — a heavy Republican tilt in part due to Pennsylvania’s partisan gerrymandering that the state Supreme Court recently ruled unconstitutional.

Instead, Tuesday night was a wakeup call for Republicans, who were test-driving their messaging strategy for the 2018 midterms — and just watched it crash into a Democratic wave.

Saccone was an expensive bet

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.

Republican-aligned groups have greatly outspent Democrats in the race. 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.

Trump’s surrogates have stumped for Saccone, and the president has gone to the district twice, most recently for a campaign rally last Saturday, in which he called on Congress to defund “sanctuary cities” and supported giving drug dealers the death penalty. The White House insisted Trump’s January visit was purely to bump the new tax law.

It was clear Republicans didn’t want to face another news cycle about the Democratic takeover.

“When Trump leaned so hard into this district, sending his surrogates and then going in Saturday — they are taking this as the bellwether of what is going to happen in the midterms and taking this as the ‘ride or die’ for what it could be,” Alison Dagnes, a political scientist with Pennsylvania’s Shippensburg University, said.

But the GOP wasn’t able to avoid the embarrassment. And Pennsylvania Republicans will face a new challenge in November. This district’s demographics will change when the seat comes for reelection under a redrawn map that’s more favorable to Democrats — with big implications for Democratic efforts to regain control of the House of Representatives in 2018. Republicans currently hold 12 of Pennsylvania’s 18 House seats with Saccone’s loss.

Republicans just test-drove their messaging — and they crashed

Republicans said their tax cuts would help them win elections. But it couldn’t secure them a Republican seat in a Trump-loving district.

This race was a rocky test drive for Republicans, who tried to put their tax plan front and center and saw their candidate suffer a devastating defeat. For weeks, the bill was the subject of countless ads and consumed Saccone’s talking points. Trump even visited 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.

At the beginning of February, almost two-thirds of GOP ads were about the Republican tax law, according to a Politico analysis — but it didn’t stick. Too much else has happened. By election day, the same groups had pivoted sharply to decrying so-called sanctuary cities in a last-ditch effort to turn out the base. That wasn’t enough either.

For now, Republicans don’t appear to be changing course; this is just another scare.

“Look, it’s going to be a centerpiece — without a doubt,” Matt Gorman, a spokesperson for the National Republican Congressional Committee, the official campaign arm for House Republicans, told the Washington Post of the GOP’s messaging strategy for 2018. “The law is getting more popular both in public and internal polls. Voters don’t need to take our word for it; they can see the companies announcing bonuses and perks for themselves.”

With an unpopular Republican president in office, and a wave of Democratic enthusiasm, Democrats think they have a shot to take back the House. And this race certainly gives them some encouragement.