The contests were seen as an early referendum on Donald Trump's first year in office.

Both parties are seeking momentum ahead of next year's midterm elections.

In Virginia — the only Southern state Trump lost last year — Republican Ed Gillespie is in a tight race with Democratic Lt. Gov. Ralph Northam. In New Jersey, Democrat Phil Murphy faces Republican Lt. Gov. Kim Guadagno, who was at the side of Gov. Chris Christie for the past eight years.

While local politics and issues weighed heavy on voters' minds, some also were driven by lingering resentment from Hillary Clinton's loss or still excited by Trump's win.

"If I could get rid of Trump I would be even happier. I've never seen our state so miserable and I've never seen our country so miserable," said John Holpp, 88, who said he voted for Murphy because he's "hoping to get rid of" Christie, who is term-limited.

Guadagno, who wants to lower property taxes and end so-called sanctuary cities, has tried to distance herself from Trump and Christie, but it's been challenging since she served as his top deputy.

In rural Virginia, Edward McKellar, 36, said the improving economy drove him to vote a straight Republican ticket.

"I like the direction our country is going right now," said McKellar, an operations manager for an industrial company. "The economy is good. It's as strong as it's ever been. The work is out there. Savings and investments are good."

Gillespie and Northam differ on taxes, guns, abortion and other issues. Gillespie supports a cut in the state's income tax rate, less gun control and more restrictions on abortions. Northam said he wants a tax overhaul that targets low-income Virginians, supports greater gun restrictions and abortion rights.

Polling places reported higher turnout than the previous gubernatorial contest, and early voter numbers were up as well. The 180,000 absentee ballots returned as of Sunday were 60,000 more than all absentee votes cast in the 2013 gubernatorial election.

Generally speaking, Democrats tend to do better in Virginia with a greater turnout.

Nationally, Democrats haven't won any special elections for Congress this year and the next Virginia governor will have a major say in the state's next round of redistricting, when Congressional lines are drawn. Republicans are looking for a boost as their party is beset by intraparty turmoil between Trump and key Republicans in Congress.

Trump recorded calls to help boost Gillespie in the final stretch. In one call, Trump said Gillespie shared his views on immigration and crime and would help "Make America Great Again." Trump also said Northam would be a "total disaster" for Virginia.

Gillespie has largely kept the president at a distance throughout the contest and did not campaign with Trump.

Political observers say the Virginia contest has been more racially charged than in recent memory. Outside groups on both sides have spent millions to influence the outcome and called on high-profile surrogates, including former President Barack Obama and Vice President Mike Pence.

Emogene and Jimmy Babb, both 74, voted straight Republican at a polling station in Windsor, Virginia. There wasn't any one particular issue that drove them to the polls but said they shared Gillespie's positions on gun rights and not removing Confederate statues.

"Statues should stay where they are," said Emogene Babb, a retired office service specialist at a local health department. "They are part of our history. We need to accept life as it was. Our forefathers fought for them."

At Jahnke Road Baptist Church in suburban Richmond, Virginia, Angelica Bega, 39, said she was uncertain whom she would vote for Tuesday until she was handed a ballot. She ultimately voted for Northam.

"I'm an issues-driven voter and it was very frustrating to see the attack ads and the emotional appeals that dominated the campaign," she said.

One tipping point was immigration. "I don't think immigration is a big deal for many Virginians, but I think that Gillespie is trying to make it an issue."

Gillespie is a former Republican National Committee and Washington lobbyist who has been criticized by Democrats and some conservatives as running a race-baiting campaign.

Northam, an Army veteran and pediatric neurologist, has lumped Gillespie in with the white supremacists who rallied in Charlottesville this summer in support of Confederate monuments.