Ralph S. Northam, Virginia’s lieutenant governor, defeated his Republican opponent, Ed Gillespie, according to The Associated Press, on Tuesday to keep the state’s governorship in Democratic hands.

Here’s what to know about Mr. Northam.

The earth rumbled

Mr. Northam, 58, is a moderate member of his party in a state rapidly leaving behind its Southern roots, but which is still troubled by its long racial shadows.

The governor’s race was shaken by a pair of seismic events: a march on Charlottesville by torch-carrying white supremacists in August, and Mr. Gillespie’s surprise embrace in the final weeks of Trumpian anti-immigration themes.

Mr. Northam stumbled a bit in his response to both. After saying he would work to remove monuments to the Confederacy, he backtracked and said the decision should be left to local officials.