It was months before a midterm election. The party that held the White House and both chambers of Congress poured resources into a special election in western Pennsylvania, in a district it had long held.

That party eked out the win. But this was the Democrats, and it was 2010, and they were crushed in November, losing 63 House seats and the majority.

“It was very hard to break through in 2010,” said Sen. Chris Van Hollen (D-Md.), who was in the House at the time and chaired the Democratic Congressional Campaign Committee. Voters tuned out their best pitches that year, when the economy was weak and President Barack Obama’s approval ratings were low.

Eight years later, this time it’s Republicans who control the White House and both chambers of Congress. Now they’re trying to keep a House seat in a special election in southwestern Pennsylvania — but their messages don’t seem to be clearly resonating with voters. Even if the GOP holds on to this seat, a narrow win would be seen as a warning sign for the party in November.

Republicans and their outside allies have thrown almost everything at Conor Lamb, the 33-year-old Democrat who’s running against Rick Saccone, a Republican veteran of Pennsylvania’s state legislature. They tried to tar Lamb as a clone of House Minority Leader Nancy Pelosi (D-Calif.), as a liberal who would raise their taxes and, lately, as a former federal prosecutor who was soft on illegal immigration.

Attacking Lamb on Pelosi and on taxes seemed to have promise. One poll showed 60 percent of voters in Pennsylvania’s 18th Congressional District had an unfavorable view of Pelosi, while another pegged the figure at 65 percent, according to GOP polling shared with The Washington Post. In addition, surveys have found increasing popularity for the $1.5 trillion tax cut amid media stories about worker bonuses and salary increases.

Conor Lamb, Democratic congressional candidate for Pennsylvania's 18th District, greets supporters as he arrives for a rally at the United Steelworkers Building on Friday in Pittsburgh. (Drew Angerer/Getty Images)

However, Lamb’s call for a nonpartisan, results-oriented Congress with new leadership — he pledged to oppose Pelosi in future leadership races — has risen above the negative advertising coming from Washington-based GOP groups. He defined himself right away in the race as a Marine who likes to hunt with rifles who then became an assistant U.S. attorney who prosecuted bad guys.

Saccone has an impressive biography as well — an Air Force intelligence officer who spent 12 years in South Korea and worked on disarmament issues with the North — but he raised so little money that he has generally been defined by his conservative voting record in Harrisburg.

Some Republicans are privately bracing for defeat, and even the optimists contend that a narrow Saccone win should still send signals of how strong the head winds are going into November.

Republicans acknowledge that the tax-cut message has been slow to take hold in this largely working-class district, as the legislation was approved when the special-election campaign was already underway. Lamb opposed the tax cut, but Republicans discovered that alone was not a potent message. It only became effective by airing ads accusing him of being in line with Pelosi on taxes.

Another problem with tax-cut messaging is how initially dubious voters are of any new law from Congress.

“The American public is skeptical of anything that comes out of Washington,” said Tim Phillips, president of Americans for Prosperity (AFP), a conservative group funded by the industrialist Koch brothers and stumping for Saccone.

Phillips has not given up. AFP is running an aggressive direct-mail and field operation, knocking on doors and making telephone calls trying to turn out conservatives. The message against Lamb is simple, he said: “This guy would not have voted for tax cuts.”

Republicans cannot believe how much money they’ve spent for such little return, never landing a fatal blow on Lamb, a first-time candidate.

The National Republican Congressional Committee (NRCC) and the Congressional Leadership Fund, a super PAC supporting House GOP leaders, spent roughly $5.5 million combined on advertising, according to a Democratic estimate of week-by-week advertising. A few other groups helped push the total to well in excess of $7 million on advertising benefiting Saccone.

For most of February, Republicans had a 2-to-1 edge in TV and radio advertising. And these groups spent millions more on other parts of the campaign, such as digital advertising and get-out-the-vote operations.

Lamb has had some modest help from Washington-based groups, but mostly it’s come from within his own well-financed campaign. Lamb’s final week of TV and radio ads, worth more than $1.2 million, according to Democratic estimates, is more than Saccone raised for his entire campaign.

Van Hollen, who now runs the Democratic Senatorial Campaign Committee, said he believes Republicans are suffering the same message problem as Democrats did in 2010, as they cannot shift the blame to anyone else.

“Right now, the reality is they are in charge of everything,” Van Hollen said. “They are in charge of a dysfunctional White House, they’re in charge of a Congress that is doubling down on giveaways to powerful special interests.”

Democrats also say there are diminishing returns on how much the Pelosi attack line has, with the GOP groups focusing so much on the issue that it lost its punch in the last two weeks of the campaign.

Republicans still say the tax-cut bill will resonate with voters in November, but they’re watching Tuesday’s election closely. They still have almost seven months to fine-tune their message on the most significant legislative achievement in the Trump era.

“Look, it’s going to be a centerpiece — without a doubt. 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,” said Matt Gorman, a spokesman for the NRCC.

For many Democrats, that reminds them of how they spoke in the spring of 2010, just after they passed the Affordable Care Act and claimed it would get so popular that it would break through the noise and keep them politically afloat. It didn’t.

“All signs point to a wave in this election,” Van Hollen said. “The only question has been how big a wave this will be.”

Paul KanePaul Kane is The Washington Post's senior congressional correspondent and columnist. His column about the 115th Congress, @PKCapitol, appears throughout the week and on Sundays. He joined The Post in 2007. Follow