RICHMOND — Virginians showed up in record numbers for Tuesday's Democratic presidential primary, leading a national wave of strong voter turnout that analysts said is all about defeating President Trump.

Roughly 1.3 million Virginia voters cast ballots, about 21 percent of the electorate, according to unofficial results. That’s up from the previous record of about 986,000 votes and 18 percent of the electorate in 2008, when Barack Obama was challenging Hillary Clinton for the party’s nomination.

Back then, voters sensed history in Obama potentially becoming the first African American nominated by a major party. Tuesday’s turnout was different.

Exit polling showed that most voters were seeking a candidate — any candidate — to defeat Trump.

Virginia, which has undergone a dramatic blue shift since Trump’s win in 2016, responded more eagerly than any other state. Its turnout represented a 69 percent increase over the 2016 primary, compared to an average jump of 33 percent across nine Super Tuesday states in which the vote count is complete or has been projected by Edison Media Research.

The second-biggest increase was 60 percent in Texas.

“The interest . . . in defeating Donald Trump is so intense that it’s almost unprecedented,” Richmond political scientist Bob Holsworth said.

Former vice president Joe Biden was the beneficiary of the Virginia groundswell, easily beating Sen. Bernie Sanders (I-Vt.) and three other hopefuls as he won nine of the 14 Super Tuesday states. Nearly 60 percent of Virginia voters said they would rather nominate a candidate who can beat Trump than someone who agrees with them on major issues, according to exit polling conducted by Edison Media Research. Biden won this group by a more than 3 to 1 margin, 63 percent to 16 percent.

“It’s just extraordinary. In the commonwealth of Virginia, folks are fired up. They want to beat Trump,” former governor Terry McAuliffe (D) said in an interview. He pointed to massive jumps in turnout in the once-purple D.C. suburbs, which he said reflected “the intensity of the anti-Trump feeling in Northern Virginia.”

Based on preliminary totals at the Virginia Department of Elections, Loudoun County reported nearly 72,000 people casting votes — up from a little more than 52,000 who voted in both the Democratic and Republican primaries in 2008. Prince William County’s turnout was just shy of 71,000, up from 57,500 in the earlier contests. Biden won both counties by a wide margin.

Polling places across the state reported steady, heavy turnout all day. Cities with large African American populations also registered strong gains, with black voters accounting for a quarter of all ballots cast.

Richmond reported more than 55,000 voters, according to the early results, up from just over 41,000 in the two 2008 primaries. Norfolk’s unofficial total of nearly 34,000 voters was more than the 30,000 Democrats who voted in 2008, but just under the 38,000 total that year when the Republican primary is included.

“Anything to get Trump out of office,” Richmond voter Tara Raigns, 41, said Tuesday, after casting her ballot for former New York Mayor Mike Bloomberg, who dropped out of the race Wednesday and endorsed Biden. Raigns said she would support anyone nominated by the Democrats this fall.

Biden won all but three localities in Virginia. Floyd County in the far Southwest and the cities of Harrisonburg and Charlottesville went for Sanders.

The Democratic Party of Virginia crowed about the results on Wednesday. “Virginia Democrats aren’t taking their foot off the gas,” party spokesman Grant Fox said in an emailed statement. “Surges in Democratic turnout over the past few years have propelled us to massive victories, and these results are another sign that Virginia Democrats are fired up and ready to beat Donald Trump.”

Democrats have gained steadily in Virginia since 2016 and now control most of the state’s congressional delegation as well as the governor’s mansion and both chambers of the General Assembly — the first time in a generation the party has consolidated power in Richmond.

“It was a great turnout, and I think it’s a sign that people in Virginia are ready for a new president,” Gov. Ralph Northam said Wednesday.

The Republican Party of Virginia dismissed Biden’s win as selecting the candidate “to ultimately lose to Donald Trump.” In an emailed statement Tuesday night, state GOP chairman Jack Wilson praised Trump’s agenda for making “America a better place for all people.”

Democrats, he said, “want to destroy all of the accomplishments this administration has made, but we won’t let that happen. We made America great again in 2016 and we’re going to keep it great in 2020.”

Laura Vozzella and Scott Clement contributed to this report.