On June 13, 2017, Gillespie narrowly defeated his primary opponent Corey Stewart to win the Republican nomination for governor and was set to face incumbent Lieutenant Governor Ralph Northam, the Democratic nominee, in the November general election.