Democrats reeling from the party’s showing on Tuesday night were sharply critical of its direction and agenda — already the subject of months of infighting on Capitol Hill — concluding it threatens to devastate their efforts to hold on to the House and Senate next year much as it dragged down this year’s candidates.

In Virginia, a state that has become reliably blue in recent years, Republican Glenn Youngkin defeated Democrat Terry McAuliffe, according to an Associated Press projection; in New Jersey, Democratic Gov. Phil Murphy was struggling for his second term — results that suggested the scope of Democratic difficulty was national. There were also repudiations of liberal efforts in varied races, including in Minneapolis, where voters spurned an attempt to replace the police department with a comprehensive safety agency.

The circumstances in the two governor’s races all but confirmed the collapse of the coalition that propelled Democrats to power during the Donald Trump administration and Joe Biden to the presidency in 2020. In the election’s wake, there were fresh doubts in the party about Biden’s ability to push his domestic agenda across the finish line, and to repel the new attacks Republicans have opened on culture fronts, especially over schools. A new round of upheaval over the party’s priorities and strategies appeared imminent.

Speaking to the Washington Post, Rep. Abigail Spanberger (D- Va.) spelled out the frustration felt by Democrats in vulnerable districts. (Zach Purser Brown/The Washington Post)

An estimated 3.3 million people turned out to vote in Virginia, easily outpacing the last two gubernatorial elections. In the eyes of Democrats, that reflected alarmingly high enthusiasm in conservative strongholds and a disturbing shift in the kinds of suburban areas that powered their gains in 2018 and 2020.

“Big Republican turnout and the suburbs move back to where they were pre-Trump,” said Jared Leopold, a former Democratic Governors Association spokesman. “I think the education piece was a big part of it. Youngkin had a message about education that was framed in a positive way for parents.”

Democratic officials and strategists said that to counteract what unfolded in Virginia — strong anti-Democratic and anti-Biden energy driving the conservative base and suburban independents to vote Republican — the party needs to significantly improve its economic pitch, engage with young voters, voters of color and women under 50 far earlier and more aggressively than they have this year and renew efforts to recruit a more diverse slate of candidates.

Republican Glenn Youngkin was elected Virginia’s governor on Nov. 2, defeating his Democratic opponent, former governor Terry McAuliffe. (The Washington Post)

But the first two points rely on speeding up Biden’s agenda, which has been captive to an ideological struggle between the party’s liberal and moderate wings, top Democrats said. Democratic strategists and officials said his as-yet-unfulfilled plans to enact sweeping new investments in infrastructure and the social safety net dragged down McAuliffe with working-class voters, including women, and his inability to shepherd legislation on voting rights and police reform diminished enthusiasm among young voters and voters of color.

“If there’s not an economic reason to vote for us, there’s not a reason to vote for Democrats,” said Josh Ulibarri, a pollster for Del. Hala S. Ayala (D-Prince William), the Democratic nominee for lieutenant governor, and other down-ballot candidates. Ulibarri said McAuliffe struggled to get past the perception that national Democrats were not delivering, since, unlike the party’s incumbents in Virginia, he could not run on his own recent accomplishments. (McAuliffe served as governor from 2014 to 2018, when he was barred by Virginia law from seeking a second consecutive term.)

The challenge will be even more stark in the months ahead for Democratic congressional incumbents, Ulibarri said, since they are at the center of the gridlock.

What’s more, the results in Virginia stoked concern that centrist Democrats might urge party leaders to pause the agenda and rethink priorities, according to a Democratic member of Congress, who spoke on the condition of anonymity to be more candid.

Still others took aim at what McAuliffe represented — a 64-year-old White man, part of a more moderate Democratic Party of the past that is now losing ground to a multiethnic, more liberal base.

McAuliffe’s profile may have worked during the early Trump years, some Democrats argued, but now, women and candidates of color are more likely to excite the base. And the ability to speak directly to the concerns of female voters and voters of color is something they say was lacking in Virginia’s gubernatorial contest.

The Democratic coalition “includes Black people,” said Quentin James, the co-founder of the Collective PAC, which seeks to increase Black political engagement, “and for some reason we kind of forget that until October.”

Although the president’s party has historically faced difficulties in Virginia’s off-year elections, more often than not losing, strategists in both parties viewed the race as the clearest snapshot yet of voter attitudes ahead of the 2022 midterms, when Democrats will be defending exceedingly narrow congressional majorities.

Democrats saw the race as a test of whether they could turn out voters when their chief nemesis, Trump, was not on the ballot and Biden was falling in popularity. They were heartened by strong turnout in some areas where they have bolstered their vote in past elections.

But Republicans also appeared to turn out in big numbers, suggesting that Democratic hopes of a large drop-off among their opponents with the former president on the sidelines were misguided — a potential problem in 2022 when they will be contesting seats on far less favorable terrain than Virginia.

“It’s definitely a wake-up call,” James said. “I think we continue to underestimate our opponents and their ability to … galvanize their base.”

Even as votes began to be tallied, the themes that could shape those midterm races came into focus in the commonwealth: Biden serving as an anchor to his party’s candidates, Trump remaining a polarizing figure and new outbreaks over education, the pandemic, abortion and the economy rising amid a discomfited electorate.

Democrats have seen tying Republican rivals to Trump as a more potent way to engage their voters than unmet promises stalled on Capitol Hill. Although McAuliffe began the race with a full array of policy ideas — including on education — by its end he said Trump’s name more often than he invoked the current president. The Democrat frequently mentioned Trump’s support for Youngkin, as well as Youngkin’s praise for the 45th president, and amplified his message in mailers and television commercials.

The strategy forced Youngkin to walk a tightrope. While he rarely mentioned Trump after the GOP primary, mindful of turning off persuadable swing voters, he did not disavow him for fear of alienating the former president’s staunchest supporters. He appeared to intentionally set himself apart from Trump stylistically, wearing casual everyman clothing, shooting hoops and talking of unity.

But his most potent weapon was a deft handling of the cultural battles that Republicans pushed to the forefront, drawing in suburban voters.

Youngkin capitalized on concerns about the coronavirus, racial justice curriculums and transgender equality to advance a broader argument that Democrats were not on the side of parents. His best evidence was McAuliffe himself, whose argument in the duo’s last debate that parents should not govern how the schools teach served as a highlight in the last month of the Republican’s campaign.

Democrats first appeared to dismiss any possibility that Republicans could attack them on the schools, an issue that traditionally has been an asset to Democrats. And the party, caught in its own schisms, did not mount an effective response to the Republican effort, party strategists said.

As Election Day neared, Democratic leaders grew surprisingly open in their criticism of the inability of Biden and congressional Democrats to enact the centerpiece of their domestic agenda, and the impact that was having on the Virginia race. Twin bills to invest vast sums of money in updating the nation’s roads, bridges and other public works, bolstering social programs and combating climate change have yet to become law, although the feuding sides of the party have come to agreements in recent days. At a time when Democrats controls Congress and the White House, that has been especially frustrating to McAuliffe and his allies.

“I’ve got to tell you, in Virginia, where we’ve got a gubernatorial race tomorrow, that would have really helped Terry McAuliffe a lot if we had been able to notch that win,” Sen. Mark R. Warner (D-Va.) said Monday on MSNBC, speaking of the infrastructure plan that passed the Senate but was caught up in the House talks over the social spending plan.

Yet Biden offered a somewhat different take, illustrating how unsettled the party is about the root causes of its challenges. Speaking to reporters at the COP26 climate summit in Glasgow on Tuesday as voters were still casting ballots, Biden said he expected McAuliffe to win, and he argued that his performance in the White House should not affect his party’s performance at the ballot box.

“Even if we had passed my agenda, I wouldn’t claim, ‘We won because Biden’s agenda passed,’ ” he said. “I think it’s going to get down to, as you all know, turnout.”

Biden advisers have argued that his agenda will prove popular and improve Democrats’ political standing in time for next year’s critical elections. But some in the party feel the amount of time he has spent on it — coming after a chaotic withdrawal from Afghanistan and amid rising inflation and concerns about supply chain bottlenecks — has undercut his promise to restore calm and competence to the White House.

Virginia also appeared to signal that changing voter reactions to the pandemic may come into play as well. Biden made curbing it a central focus of his candidacy and his presidency, and for months benefited from majority support of his pushes for masks and vaccinations, which were met with resistance by many Republicans.

But the Virginia election seemed to illustrate the downside for Democrats of exhaustion with the long, tortured struggle to get back to normal life — and with their prescription for how to do that, even if proposed by health officials.

For Henrico County resident Laurel Wise, a lifelong Democrat, the issue of mask mandates during the pandemic was enough to prompt her to vote for Youngkin. “I’ve never voted for a Republican in my life, and I’m going to today,” she said.

Mariana Alfaro, Elisabeth St. Onge and Madeline Buschang contributed to this report.