She will take over after four years under Republican Glenn Youngkin.

Virginia is bordered by the liberal-leaning Washington DC to the north, where many residents work in the nation’s capital or for the federal government. But the state also has large pockets of conservative voters throughout its rural districts, and swing voters.

Spanberger had highlighted the economic impact of Trump’s cuts to the federal government, which have impacted Virginia’s employment, and ran on a platform of increasing affordability.

Fellow Democrat Ghazala Hashmi was also projected to win Virginia’s lieutenant governor’s race against Republican John Reid. The governor and lieutenant governor do not run on a joint ticket in the state.

Hashmi’s victory made her the first Muslim woman elected statewide office in the US.

The Democratic National Committee hailed Spanberger’s victory as “a resounding rejection of the self-serving and corrupt Trump establishment”.

“It’s time for Republicans to cherish their short time in power — because Democrats are going to keep winning, and we have a vision for this country that’s a lot bigger than building a ballroom,” said DNC chair Ken Martin.

Republican Earle-Sears touted Virginia’s economy under conservative leadership and leaned into cultural topics like transgender issues, which Republicans used successfully as a wedge issue in last year’s presidential election.

Trump had not formally endorsed Earle-Sears, although he encouraged Virginia voters to back all the Republican candidates up for election.

In a telephone rally on Monday to drum up support, Trump repeatedly praised the candidate for New Jersey governor but never mentioned Earle-Sears by name, according to US media.

Trump and Earle-Sears have a complicated relationship, after she declined to support his 2024 election campaign.

“A true leader understands when they have become a liability. A true leader understands that it’s time to step off the stage,” she said about Trump in 2022.