In winning the governor’s office in Virginia and mounting a serious challenge to the incumbent Democratic governor in New Jersey, Republicans are plainly energized ahead of next year’s midterm elections.

In Pennsylvania, the GOP also appeared to be on the verge of possibly sweeping all four Pennsylvania statewide judicial elections in voting that tellingly reflected a surge in Republican turnout. From Bucks County to Erie, Republicans also won big in local elections.

All together, the election results pointed to trouble for President Joe Biden and Democrats in Washington as they prepare to defend their narrow majorities in Congress next year.

And while Gov. Phil Murphy pulled out a narrow reelection victory, the tougher-than-expected challenge from Republican Jack Ciattarelli underscored a wave of GOP enthusiasm that is a warning sign for Pennsylvania Democrats as they look ahead to high-profile races next year for U.S. Senate and governor.

“Knowing how tough the judge races have historically been for us, the fact we swept the entire slate is a huge, huge alarm bell for Democrats,” said Matt Beynon, a Pennsylvania Republican consultant. “It should be a siren to Democrats that they are overreaching. This portends potentially a bloodbath next year for them.”

State Sen. Sharif Street, vice chair of the state Democratic Party, saw political headwinds from Washington, where Biden’s agenda has stalled. The president’s approval ratings have been declining amid rising inflation.

“Our core voters expect us to be able to govern at the federal level,” said Street (D., Phila.). “Democrats need to focus less on a failed ex-president and more on how to deliver for the people that have given us some modicum of power.”

Still, perhaps a key to the strong Republican performance in Virginia and New Jersey was that the party’s standard-bearers weren’t perceived as being too closely aligned with former President Donald Trump, a challenge that could be trickier to navigate in a state like Pennsylvania somewhat more favorable to the former president. Trump won the state in 2016 and narrowly lost last year. In contrast, he was soundly defeated in 2016 and 2020 in both Virginia and New Jersey.

» READ MORE: Pa.’s election was sleepy compared with 2020. Some voters still saw high stakes: ‘The country’s just in such a state.’

As of Wednesday afternoon, Republicans had been projected to win at least three of four statewide appellate judgeships, including the marquee race for state Supreme Court. The GOP was also ahead in the race for the fourth seat.

And the judicial elections weren’t particularly close. Republican Kevin Brobson had a five-point lead over Democrat Maria McLaughlin in the Supreme Court race, while Republican Megan Sullivan had a double-digit lead in the Superior Court election.

That’s not because Democratic voters didn’t show up: Democrats at the top of the ticket actually got more votes this year than did the party’s largely successful judicial candidates in 2017. The difference this time is that Republican turnout surged: Brobson had more than 1.3 million votes as of Wednesday morning, up from just over one million ballots cast for the GOP Supreme Court nominee four years ago.

Likewise, in New Jersey, Murphy got a similar number of votes — 1.2 million — as he did when he won by double digits four years ago. But Ciattarelli got about 300,000 more votes than the previous GOP nominee, Kim Guadagno.

Republicans said Biden’s poor performance has energized their supporters, even without Trump on the ballot.

“He’s our best asset right now and I don’t believe he’s going to get any better,” Sen. Rick Scott (R., Fla.), head of the GOP’s Senate campaign arm, said last week.

In the Philadelphia suburbs, Republicans clawed back some of the local offices they lost during Trump’s presidency.

Bucks County District Attorney Matt Weintraub, a Republican and the last one to hold a row office in the Philly suburbs, cruised to reelection. The GOP also won races for sheriff and prothonotary, which Democrats had won four years ago for the first time in decades.

In Delaware County, Democrats narrowly held on to county council seats they had wrested from Republicans for the first time four years ago. Countywide elections in Chester County were too close to call, with thousands of mail ballots yet to be counted.

There were signs outside the region of more GOP momentum.

In northwestern Pennsylvania, Erie, a bellwether, voters elected a Republican county executive to the seat, which has overwhelmingly been held by Democrats since the 1970s. In Northampton, the Democratic incumbent held on to the county executive seat, and Democrats were narrowly poised to maintain control of county council.

» READ MORE: Two Pa. swing counties’ elections could offer clues for the year ahead

And in Southwestern Pennsylvania, where former Democratic strongholds outside Pittsburgh have been trending Republican for years, the GOP made further gains. Westmoreland County’s longtime Democratic district attorney, John Peck, lost to Republican Nicole Ziccarelli.

Democrats on Wednesday were taking stock of the damage. The most prominent loss was in Virginia, where Republican Glenn Youngkin beat Democrat Terry McAuliffe.

Democratic consultant Mustafa Rashed said Democrats failed to deliver a coherent message, whereas Republicans were fired up over social issues.

“I don’t think your average person understands [budget] reconciliation. Your average person does not understand the filibuster,” Rashed said. “What they know is Democrats are in control of the White House, the House, and the Senate, and things are not getting done. You’ve been there for a year and people are like, ‘Why is this taking so long?’ And if you’re not able to use that to fire people up, it makes it really hard ... for people to get excited.”

The 2022 warning signs were particularly acute for House Democrats in battlegrounds around Pennsylvania and New Jersey. The affluent suburbs that had swung so hard in their direction during the Trump years rebounded back toward Republicans — a warning sign for swing-district Democrats like Susan Wild and Chrissy Houlahan in Pennsylvania, and Andy Kim and Tom Malinowski in New Jersey.

In South Jersey’s Burlington County, the blue-leaning base for Kim’s district, Murphy was winning by just 5 percentage points — after Biden captured the county by nearly 20. In Somerset County, a 21-point Biden victory shrank to a two-point edge for Murphy. That central New Jersey county is critical for Malinowski’s 7th District, a top target for Republicans.

Virginia’s Loudoun County, meanwhile, offers some parallels to some of Pennsylvania’s swing suburbs, like Chester County. It’s affluent, diversifying, and only recently turned blue, while also holding some rural and exurban portions. Its moderate voters sharply rejected Trump — he won just 36.5% of the vote there in 2020. But on Tuesday Youngkin got nearly 45%, a significant improvement that also signaled the suburbs could be swinging rightward.

The results also underscore a message within the 2020 election: While many suburban voters that year rejected Trump, they didn’t reject Republicans writ large. The GOP won statewide races for auditor general and treasurer and beat back Democrats’ efforts to flip the legislature.

Candidates were already trying to take control of the narrative for their own campaign. Pennsylvania Attorney General Josh Shapiro, the lone Democrat running to succeed Democratic Gov. Tom Wolf, sent out a fund-raising email cautioning supporters, “I have to be blunt: A Republican candidate for governor could win here in Pennsylvania next year, too.”

Lou Barletta, a Republican candidate for governor, countered with his own fund-raising appeal: “Buckle up Josh, there’s a RED WAVE coming to PA in 2022 based on common sense.”

In both Virginia and New Jersey, the Republican gubernatorial candidates appeared to win support from Trump’s supporters without personally tying their candidacies too closely to the former president himself. It remains to be seen whether that will happen in Pennsylvania’s U.S. Senate and gubernatorial races next year, as most of the high-profile candidates have been eager to prove their pro-Trump bona fides.

Both GOP primary races are still fluid. For example, Republican Dave White, a former Delaware County Council member and construction contractor who has ties to organized labor, is expected to announce his campaign for governor Saturday.

His campaign materials are indicative of the kind of message many Republicans are trying to strike. “Cutting his teeth as a blue-collar worker, Dave understands that the Republican Party is the party of the working Pennsylvanian,” his campaign bio says. “That is why he was a supporter of President Donald J. Trump’s America First agenda.”