US Democrat Ralph Northam has defeated Republican Ed Gillespie in the race for the governorship of Virginia, marking his party’s first major Trump-era victory.

The results in the state were replicated in several contests across America yesterday as the Trump resistance struck back.

Mr Northam, a paediatric neurologist and Army veteran, led Mr Gillespie by several points as the final votes ticked in.

Democrats also scored victories in the gubernatorial race for New Jersey and in Maine, where voters slapped the state’s Republican governor, a Trump ally, by backing a measure to expand Medicaid coverage under former president Barack Obama’s flagship health care law.

The Democratic mayors of New York and Boston, both vocal Trump critics, also won re-election easily.

Virginia voters also elected the state’s first openly-transgender state representative, among more than a dozen state legislative gains for Democrats.

The resounding victories marked the Republicans’ most significant day of defeat in Donald Trump’s presidency, as well as a rebuke to the leader himself as his party eyes a suddenly more threatening mid-term election season next year.

Democratic National Committee Chairman Tom Perez said: “The Democratic Party is back.”

As Democrats celebrated, Republicans pointed fingers. The president himself tweeted: “Ed Gillespie worked hard but did not embrace me or what I stand for.”

Mr Trump did note that his party won a handful of special elections earlier in the year, adding: “With the economy doing record numbers, we will continue to win, even bigger than before!”

Despite the criticism, Mr Gillespie did, in many ways, embrace what Mr Trump stands for, even if he did not welcome the president into the state to rally voters on his behalf.

Mr Trump played a marginal role in Virginia, largely because Republicans on the ground did not want him there, a state he lost last autumn.

In New Jersey, Democrat Phil Murphy trounced Republican Lt Gov Kim Guadagno, who served under the term-limited, deeply unpopular Republican governor Chris Christie.

Democrats picked up a state Senate seat in Washington state, taking control of the state legislature.