FAIRFAX, US - Virginians cast ballots Tuesday in a closely-watched race for governor that has national ramifications as a test for the Republican Party and the divisive campaign style of unpopular President Donald Trump.

It is the most consequential US election of the year, although voters in New Jersey are also choosing a new governor, and several cities and states are electing mayors and local lawmakers.

The gubernatorial races in particular are seen as bellwethers of sentiment one year after Trump's shock victory, and ahead of next November's congressional elections.

A win in battleground Virginia by Democratic Lieutenant Governor Ralph Northam would signal voter rejection of Trump's economic policies and his scorched-earth 2016 campaign, whose polarizing tactics have darkened his presidency.

It would also energize the Democratic Party - currently plagued by infighting - ahead of the 2018 mid-terms, and show Republicans that coddling the controversial Trump comes at a price.

Virginia voted twice for former president Barack Obama, and Hillary Clinton carried the state in last year's presidential election that Trump won. But with polls showing Northam narrowly ahead, Virginia's race could go either way.

Clinton hoped Democratic voters were leaving nothing to chance. "Consider this my personal ask/nudge/plea for you to go to the polls and VOTE," she tweeted Tuesday.

A victory for Republican challenger Ed Gillespie would likely validate Trump's aggressive style.

Gillespie pledged to be "a governor for all Virginians" at his final campaign stop Monday, when about 100 people crammed into a Republican Party office basement in Fairfax. But shortly before Gillespie spoke, it was campaign manager Pete Snyder who acknowledged the race was more than a sideshow.

"The eyes of the nation are on Virginia," Snyder said. "Everyone is watching."

That includes Trump himself, who tweeted his support for Gillespie for a second straight day Tuesday and highlighted the hot-button social issues that he hopes will bring his base out to the polls.

"Ralph Northam will allow crime to be rampant in Virginia. He's weak on crime, weak on our GREAT VETS, Anti-Second Amendment... and has been horrible on Virginia economy," Trump posted on Twitter.

Trump has not campaigned with Gillespie, but the candidate's many campaign ads, which have fueled the debate on race, guns, illegal immigration and the fate of Confederate statues, signal clear alignment with the president.

"It's Donald Trump on steroids," current Democratic Governor Terry McAuliffe told WQRX radio.

Gillespie, a former Republican Party chief, exudes establishment politics. But the 56-year-old is looking to harness Trump's populist nationalism in a place where an increasingly diverse electorate is making it tougher for Republicans to win state-wide contests.

"I appreciate his support very much and I know it'll help me be an effective governor for us," Gillespie said of Trump, at a voting station in Alexandria in the Democratic stronghold of northern Virginia. "I feel good about the momentum we have as we close out this election."

What happens in Virginia's political petri dish could impact Republican strategies nationwide come 2020, the next presidential campaign.

Gillespie has accused Northam, 58, of failing to curb gang violence, making it easier for sex offenders to purchase guns, and seeking to tear down statues honoring Civil War pro-slavery Confederate secessionists.

Northern Virginia, which borders Washington, hosts a thriving economy with thousands of federal employees and a robust technology sector. Aside from the capital Richmond and eastern counties, the rest of the state is largely conservative.

Trump's base consists of white voters without college degrees, but Virginia is well-educated.

If Trump does not prove a drag on Virginia voters, it would demonstrate his power to draw Americans to polls despite poor approval numbers.

Gillespie first must overcome the likes of 81-year-old Barton, a retired psychiatrist who did not give his last name, and told AFP he would vote against Trump "any chance I have."

"He gives me nightmares," Barton added.