Democrats have scored two significant victories in the US – in the first statewide elections since President Donald Trump came to power in January.
In Virginia, Ralph Northam defeated Republican Ed Gillespie in a governorship race marked by tussles on immigration and Confederate statues.
Phil Murphy, who beat Kim Guadagno, will be New Jersey governor.
The results could give an early indication of how next year’s midterm congressional elections will turn out.
New York City’s Democrat mayor was also comfortably re-elected.
Meanwhile, Virginia voters also made history by electing their first openly transgender state legislator.
Democrats have been craving something to celebrate after defeat in four congressional special elections this year, despite a groundswell of grassroots opposition to President Trump.
Overcoming the flip-flops
With nearly all the votes countered in Virginia, Mr Northam had 53.9% against 44.9% for Mr Gillespie.
Mr Northam, the lieutenant governor of Virginia, will now replace popular Governor Terry McAuliffe, a Democrat.
Mr Northam won despite a series of flip-flops during the campaign.
Progressive supporters were outraged after Mr Northam reversed stance to say he would oppose any attempt by a Virginia city to provide sanctuary to illegal immigrants.
The Democrat offered to work with President Trump after previously calling him “a narcissistic maniac”.
Mr Northam also vowed to lead efforts to remove Confederate statues, only to say later that he would leave the decision to local authorities.
And his camp was further embarrassed by a racially charged advert, released by a group supporting his candidacy.
Mr Gillespie, a Washington lobbyist and former Republican party chairman, had accused Mr Northam of failing to curb gang violence and seeking to tear down statues honouring Civil War, pro-slavery secessionists.