RICHMOND — Former vice president Joe Biden won Virginia's Democratic primary contest by a large margin Tuesday, with exit polls showing that voters chose mainly based on who they thought had the best chance of beating President Trump this fall.

The broad victory confirmed Biden's renewed strength after his lackluster early showings and suggested the appeal of an establishment candidate to a wide swath of voters anxious to find a winner in the fractious Democratic field.

Biden was powered by African American voters, who accounted for about a quarter of those casting ballots in Virginia on Tuesday, according to exit polling conducted by Edison Media Research. Roughly 6 in 10 black voters chose Biden — similar to the outcome in his victory last weekend in South Carolina.

But Biden also won among white Virginia voters, thanks primarily to those older than 45 — 6 in 10 of whom voted for the former vice president, polling showed. Voters younger than 30 went for Sen. Bernie Sanders (I-Vt.) by a margin of nearly 3 to 1, but he still trailed Biden by about 30 points, according to unofficial returns.

Former New York mayor Mike Bloomberg, who saturated the state with advertising and spent heavily in last year's legislative races, was a distant fourth, behind Sen. Elizabeth Warren of Massachusetts. Turnout was above 23 percent, breaking the record for a Virginia Democratic primary set in 2008, when Barack Obama won the nomination.

Unofficial returns Wednesday morning showed Biden with more than 53 percent of the vote, while Sanders had 23 percent. Warren had nearly 11 percent and Bloomberg came in below 10 percent.

Voters across the state said Biden emerged as their pick late in the game. Many settled on him after preferred candidates dropped out. Others didn't decide until they stood in the voting booth. But most shared one goal:

"I want to get Trump out of office by all means necessary," said Josephine Stewart, 66, a cook in Richmond public schools. She opted for Biden.

How Virginians made their choices will shed light on the challenge facing the party nationwide. Gains in recent elections have energized the state's Democrats, but they've been powered by an uneasy combination of ethnically diverse young liberals and more cautious suburbanites who once leaned Republican.

In other words, Virginia is still deciding its shade of blue. And that uncertainty followed voters to the polls.

Walking into Lynbrook Elementary School in Springfield, stay-at-home father Oscar Trejo, 34, said his choice was Biden.

“Really? I’m for Bernie,” said his wife, Alejandra Trejo, 33, who viewed Sanders as a stronger force for change.

The dilemma mirrors what the Democratic nominee will face nationwide, making Virginia’s choice on Super Tuesday significant beyond the 124 delegates the state offers at the nominating convention.

Ninety-nine of those delegates were at stake Tuesday; the remaining 25 are superdelegates not beholden to the outcome at the polls.

Most Virginia voters opted for pragmatism. A majority sought a candidate who they think can beat Trump over one who agrees with them on major issues, according to exit polls. Biden won about 6 in 10 of those votes, while Sanders got about 2 in 10.

Among Virginia voters who prioritized issues, Biden ran almost even with Sanders. That’s a contrast with earlier contests in Iowa, New Hampshire and Nevada, where Sanders had a clear edge on issues.

Biden also benefited from the decisions of Sen. Amy Klobuchar of Minnesota and former South Bend, Ind., mayor Pete Buttigieg to quit the race and endorse him. Most of their Virginia supporters turned to Biden, the exit polling found.

At Rosemont Forest Elementary in Virginia Beach, Biden voters Jermel McLean and Alisha Weeks — both 43 and engaged to be married — said they liked some things about Sanders but “figured Joe would beat Trump.”

Ashley Hubbs, 34, also turned to Biden — reluctantly — after enthusiastically supporting and volunteering for Buttigieg’s campaign. She said she almost voted for Warren, until she learned that Buttigieg had endorsed Biden.

“It didn’t give me a lot of pleasure, but we have to unify the party,” Hubbs said outside Windsor Oaks Elementary in Virginia Beach. “It would have been nice to have a couple days to mourn how hard we worked for Pete, but eyes forward.”

In an affluent Richmond suburb in Henrico County, Anna Lauher was so conflicted about her choice for president that she considered leaving it to chance.

“At first, I was going to [decide by] eenie meenie miney moe,” she said on her way out of Tuckahoe Elementary School. But that approach landed her on Sanders, the democratic socialist whom Lauher’s Trump-loving father had urged her to support on the theory that “Trump would chew him up and spit him out.”

Rejecting that option, she considered Bloomberg, who she thought did a good job of rebuilding New York City after the Sept. 11 terrorist attacks. But ultimately, Lauher picked Warren on the advice of a friend.

“I like the idea of trying to see a woman succeed,” said Lauher, 32, a stay-at-home mother who voted with her baby daughter, Margaret, in a pouch on her chest.

Virginia’s establishment Democrats came out hard for Biden in the past few days. Former governor Terry McAuliffe led the charge, pumping up crowds and rallying other leaders, including Sen. Tim Kaine, Richmond Mayor Levar Stoney and Del. Lamont Bagby (Henrico), head of the legislature’s Black Caucus.

At a polling place in a largely black neighborhood in South Richmond, most voters interviewed said they were backing Biden.

“He’s for the people that are struggling,” Angela Williams, 33, said. But more than that, she said, Biden is the one “to get Trump out of the chair. . . . As a businessman, I love [Trump]. But as president? No.”

Sanders had not amassed many endorsements in Virginia. But he held big rallies in Northern Virginia, Richmond and Hampton Roads. Warren made several trips to the state and picked up endorsements but did not seem to tap as much liberal fire as Sanders, whose likeness has been on a giant mural along a busy Richmond thoroughfare since he ran for the nomination in 2016.

Elido Reyes, 25, who is black and Latino, said Sanders was the only candidate talking about issues that matter to him, such as universal health care, making education affordable to all and addressing police violence.

The Norfolk resident said he isn’t sure he’ll vote this fall if the nominee isn’t Sanders.

“I’m not going to just be the minority who votes Democrat,” Reyes said. “The institutional Democratic Party isn’t something I appreciate, and it doesn’t seem to have done much for people like my family and friends.”

At Yorkshire Elementary School in Manassas, Tim York cheerfully announced that he, too, chose Sanders in the open primary — in hopes of helping Trump get reelected in November.

“He’s the weakest candidate,” York, 39, said of Sanders, predicting that the senator’s calls for Medicare-for-all and free college tuition would turn off moderate voters. “I think the president has a good chance, regardless, but especially against Bernie.”

Concern that Sanders is vulnerable to Trump drove many voters to settle on Biden as the safer bet.

Monica Moore, 55, was among many suburban voters still torn between candidates on voting day. She said she likes Sanders’s policies, but Biden seems more electable. At Yorkshire Elementary, she picked Biden.

“I walked in, and wherever my hand went first, that’s who I was voting for,” Moore said.

In Henrico, Kate Giska, 39, a small-business owner and political independent, described Sanders as “just too extreme, just like Trump is a little too extreme. We’re kind of, like, in the middle, just, like, status quo, just get along.”

She voted for Biden, someone she said has appeal for “the middle voter, a candidate that can attract the masses.”

None of more than 50 voters interviewed at three Virginia Beach precincts on Tuesday said they planned to vote for Sanders, even if they liked some of his positions. Many said they simply thought Biden had a better chance of winning in November.

“This is a tough, tough year,” said Donnell Burton, 68.

“I know we need change, but I don’t know if we need Bernie,” he said. “One thing I do know is, Trump has to go.”

Rachel Chason, Fenit Nirappil and Antonio Olivo in Northern Virginia, Scott Clement in Washington, Joe Heim in Virginia Beach and Laura Vozzella in Richmond contributed to this report.