The Democrats have taken their first major victories of the Trump era with wins in the governor races in New Jersey and Virginia.

Irish-American Phil Murphy has been elected Governor of New Jersey, replacing outgoing two-term Republican Governor Chris Christie, whose tenure ends with his approval rating at record lows.

Mr Murphy, a former investment banker and ambassador to Germany, beat Republican Lieutenant Governor Kim Guadagno, who was hampered by her association with Mr Christie, a one-time presidential candidate.

In Virginia, Democrat Ralph Northam won a bitter race for governor, dealing a setback to President Donald Trump with a decisive victory over a Republican who had adopted some of the president's combative tactics and issues.

Mr Northam, the state's lieutenant governor, overcame a barrage of attack ads by Republican Ed Gillespie that hit the soft-spoken Democrat on divisive issues such as immigration, gang crime and Confederate statues.

One year since Trump's dramatic election win

Mr Trump, who endorsed Mr Gillespie but did not campaign with him, had taken a break from his Asia trip to send tweets and record messages supporting the former chairman of the Republican National Committee.

But after the outcome, Mr Trump quickly distanced himself from Mr Gillespie.

At his victory party, Mr Northam told supporters the sweeping Democratic win in Virginia sent a message to the country.

"Virginia has told us to end the divisiveness, that we will not condone hatred and bigotry, and to end the politics that have torn this country apart," Mr Northam said.

Mr Murphy's win and Mr Northam's victory in Virginia, a state Democrat Hillary Clinton won by 5 percentage points in the 2016 presidential election, provided a much-needed boost for national Democrats who were desperate to turn grassroots resistance to Mr Trump into election victories.

Democrats had already lost four special congressional elections earlier this year.

In local races across the country, Democratic Mayor Bill de Blasio in New York and Marty Walsh in Boston both easily won re-election.

Voters were also picking mayors in Detroit, Atlanta, Seattle and Charlotte, North Carolina.

In Virginia, Danica Roem became the state's - and possibly the country’s - first openly transgender state delegate.

The 33-year-old musician and former journalist prevailed in her race against Republican Robert Marshall, who had served as a delegate for more than 25 years and once referred to himself as Virginia's "chief homophobe".

Elsewhere in Virginia, the partner of a television reporter shot dead on air has won a seat in the state legislature.

Chris Hurst, whose girlfriend Alison Parker was murdered on live television, beat an NRA backed incumbent on a campaign of gun control.