Story highlights On the Democratic side, Lt. Gov. Ralph Northam is on track to win the nomination

The close Republican race came as a major surprise

Washington (CNN) Ed Gillespie was expected to hold onto a narrow lead to win the Republican nomination for Virginia governor in his party's primary election Tuesday evening, CNN projected.

On the Democratic side, Lt. Gov. Ralph Northam is on track to win the nomination for Virginia governor, CNN has projected.

Gillespie's tight victory over Prince William County Board of Supervisors chair Corey Stewart came as a major surprise. Observers initially expected it to be an easy win for Gillespie, a former chairman of the Republican National Committee. Frank Wagner, a senator in the commonwealth's legislature, trailed in third place.

Meanwhile, Northam's win capped off fierce competition on the Democratic side, where he faced off against former congressman Tom Perriello. And turnout in the Democratic primary far outpaced the Republican side.

In a statement congratulating Northam, outgoing Democratic Gov. Terry McAuliffe linked the Republican field to President Donald Trump.