Democrat Ralph Northam will be Virginia's next governor, beating Republican Ed Gillespie as part of a wave of Democratic victories Tuesday night — maintaining control of three statewide offices and flipping 14 seats in the House of Delegates.

The scene at Northam’s rally on Tuesday night.

Democrat Ralph Northam will be Virginia's next governor, beating Republican Ed Gillespie as part of a wave of Democratic victories Tuesday night — maintaining control of three statewide offices and flipping 14 seats in the House of Delegates.

WASHINGTON — Democrat Ralph Northam has won Virginia’s hard-fought race for governor, beating Republican Ed Gillespie on a night that saw Democrats flip at least 14 Republican-held seats in the House of Delegates – including seven in Northern Virginia.

In a widely considered repudiation of President Donald Trump’s administration, Democrats swept all three statewide races including lieutenant governor and attorney general with help from vote-rich Northern Virginia, where Northam won by large margins.

“We need to close the wounds that divide and bring unity to Virginia. Whether you voted for me or not, we are all Virginians,” Northam said in a victory speech before supporters gathered at George Mason University Tuesday night. “I hope to earn your confidence and support as we move forward. The Virginia way is to work together.”

Northam said that Virginia sent a message that would be heard around the country.

“We live in a very diverse society … it is that diverse society that makes this country great,” he said. “As long as I’m governor, I will make sure that we are inclusive that we welcome people to the Commonwealth of Virginia. Our lights will be on, our doors will be open.”

Northam took 54 percent of the vote statewide to Gillespie’s 45 percent. Libertarian candidate Cliff Hyra received just 1 percent of the votes cast, according to unofficial election results.

Herring won re-election with 53 percent of the vote statewide, topping Republican challenger John Adams. Justin Fairfax took 53 percent of the vote, besting state Sen. Jill Vogel, who took 47 percent of the vote statewide, in the race of lieutenant governor, according to unofficial election results.

Elsewhere in the state, Northam locked in the state’s other population centers including the city of Richmond and suburban Henrico County, Hampton Roads communities and the city of Roanoke.

In a speech before supporters at a Hilton in Richmond, Gillespie thanked all who voted, even those who cast ballots for his opponent, Northam.

“More than 1 million Virginians came out expressing legitimate concerns about the need for more opportunity in the commonwealth, the need for full-time stable jobs,” Gillespie said of those who voted for the former Republican National Committee Chair.

“These million voters love our commonwealth, they love our fellow Virginians. They too are rooting for our new governor to succeed,” he said.

Democrats said that the results of Tuesday’s election was a renunciation of President Donald Trump’s politics and the policies of Republicans in the General Assembly on issues of abortion rights, the economy and even Medicaid.

“You rejected Donald Trump’s fear, hatred and bigotry,” said Gov. Terry McAuliffe, who is barred by term limits from seeking a second term. “Tonight is a wake up call in this country … we will fight for every single person, no matter whom you love, no matter the color of your skin.”

The race for governor was considered the first test of voter sentiment in the year since Donald Trump was elected to the White House. At stake for both parties was momentum and voter enthusiasm heading into the crucial midterm congressional elections next year.

Trump endorsed Gillespie, who did not entirely embrace the president’s support or his politics. But he attacked Northam on immigration enforcement and public safety issues in an effort to woo Trump supporters. Northam aired ads targeting Gillespie’s anti-abortion positions.

Trump quickly distanced himself from the Republican tweeting that Gillespie “worked hard but did not embrace me or what I stand for.”

The competitive race tightened in recent weeks and the number of attack ads flourished. The two candidates each spent more than $23 million on the race.

As Virginia’s next governor, Northam will oversee redistricting — drawing new lines for legislative and congressional districts — and could blunt efforts by a Republican-led legislature to draw districts to their advantage.

But the economy, abortion, taxes and Trump were the issues that drove Virginians to the polls in large numbers for an off-year election.

Despite the rain, turnout was heavy in vote-rich Northern Virginia Tuesday. Fairfax County, the largest locality in the state, reported a turnout of 56 percent — higher than the turnout four years ago. Arlington County reported 55 percent turnout and Alexandria reported turnout of 47 percent.

Dinesh Aurora said he normally votes just in presidential elections, but he made the trip to a swing precinct in Fairfax County Tuesday evening, noting he’s not “a fan” of Trump.

“I don’t appreciate what’s going on so I made it a point to vote and try to change the outcome of what’s happening around us.”

For Amanda Thomas, reproductive rights was her top issue as she headed to vote in the Fair Oaks section of Fairfax County. But President Donald Trump also spurred her to vote.

“I don’t identify very strongly with one party or the other. But I don’t support the current president and I know that he endorsed the Republican candidate Gillespie,” said Thomas, who voted for Northam.

Willie Nesbitt called himself an independent, but he voted for Gillespie, saying that the Democrats don’t represent his values on same-sex marriage, immigration, or even transportation — he opposes the 66 express lane project.

“Give somebody else a chance, see what happens. If that guy doesn’t do it, I’ll vote them out too,” Nesbitt said.

Don Dallman, of Prince William County, also voted for Gillespie after supporting his primary opponent Corey Stewart in June.

“We need to lower the taxes,” said Dallman at a precinct in Nokesville. “The government has just gotten too big. I’m doing my part to try to see if we can’t reduce taxes, reduce government, reduce all the restrictions and rules and regulations that we have to live with every day.“

Election officials were investigating complaints that some voters in Prince William and Fairfax counties had received calls falsely claiming that their polling place had changed.

The NAACP in Prince William County said residents received robocalls that their polling location had changed, and Fairfax County’s Office of Electoral Board confirmed similar calls and texts in the region.