RICHMOND — Since President Trump took office, voter turnout has surged in Virginia, the state that holds elections every year, leading analysts to conclude that even local races have turned into referendums on the president.

“We’ve seen, across the Trump presidency so far, huge spikes in turnout in Virginia,” said Stephen Farnsworth, a University of Mary Washington political scientist. “And it’s very clear that President Donald Trump brings a lot of people to the voting booth. Some vote in support, but, as we saw in Virginia, more vote in opposition.”

Trump lost Virginia by six points in 2016, making it the only Southern state carried by Hillary Clinton. Since that presidential election, off-year turnout in the state has spiked, according to an analysis by the nonpartisan Virginia Public Access Project.

Voters in Virginia, where Western democracy began 400 years ago, have always been pretty good about going to the polls every four years, when there’s a presidential contest on the ballot. About 70 percent of the state’s voters show up for that.

But turnout has tended to plummet — to 30 or 40 percent — in the off years, when it’s time to pick a governor and other statewide officials, members of Congress, or state legislators.

Trump seems to have disrupted that pattern. Voters who love or loathe the president have gone to the polls in record numbers to register their support or opposition.

The year after Barack Obama won the White House, 40 percent of Virginia voters cast ballots in the 2009 governor’s race, won by Republican Robert F. McDonnell. In 2013, a year after Obama won a second term, 43 percent of voters participated in elections that put Democrat Terry McAuliffe in the Executive Mansion.

Yet turnout was 48 percent in 2017, a year after Trump’s election, when Democrat Ralph Northam won the governorship over Republican Ed Gillespie.

Forty-four percent of voters cast ballots in congressional elections in 2010. And 42 percent did so in 2014, for congressional contests and a nail-biter between Sen. Mark R. Warner (D) and Gillespie. But turnout spiked to 60 percent for congressional races in 2018.

Turnout traditionally hits its nadir the year before presidential elections, when every seat in the Virginia House of Delegates and Senate is on the ballot, without any statewide or federal contests. Those “off-off year” elections drew about 29 percent of voters in 2011 and 2015.

But last year, turnout hit a record 43 percent in contests that gave Democrats control of the state House and Senate for the first time in a generation.

“Two words: Donald Trump,” said Grant Fox, spokesman for the Democratic Party of Virginia. “Virginians are taking any chance they can get to stick it to Donald Trump and his party at the polls, which is why the surge in off-year turnout has brought historic Democratic victories.”

Jack Wilson, chairman of the Republican Party of Virginia, said Trump’s election has stirred Democrats and Republicans alike, noting that GOP turnout has spiked — just not as much as on the Democratic side.

“Clearly there was an energized Republican base, and you really saw it in the more rural areas,” he said.

In 2017, Gillespie got 1.18 million votes for governor, the second-highest total for any gubernatorial candidate — behind Northam, of course, who got 1.4 million votes and a nine-point win.

Even Corey Stewart, a Trump acolyte who received a 16-point trouncing from Sen. Tim Kaine (D) in 2018, got more votes than Gillespie or Warner in their 2014 Senate battle. While Stewart’s 1.37 million votes fell far behind Kaine’s 1.9 million, he was ahead of Warner’s 1.07 million and Gillespie’s 1.06 million.

Farnsworth said Trump has not been the only factor, particularly in November’s elections, when it was clear that the state House and Senate were both up for grabs. Republicans had an overwhelming majority in the House until 2017, when Democrats — surprising even themselves — picked up 15 seats.

Heading into Nov. 5, Republicans were defending narrow majorities of 20 to 19 in the Senate and 51 to 48 in the House, with one vacancy in each chamber. As it turned out, Democrats picked up six seats in the House, which as of Jan. 8 they will control 55 to 45, and two in the Senate, which they will lead 21 to 19.

“Virginia faced a pivotal election in 2019 with control of both the House of Delegates and the Senate of Virginia at risk,” Farnsworth said. “And as a result of this, Democrats and Republicans engaged in a particularly intense election cycle. Extraordinary amounts of money were delivered to both parties, and top-quality candidates decided to run.

“And so, to me, there are really two factors here. One is President Trump, but the other is the key nature of this election for the future of Virginia. It was clear to anyone even thinking about voting that 2019 was an election not to miss.”