Voters in Virginia and New Jersey gave Democratic gubernatorial candidates large victories on Tuesday and sent a clear message of rebuke to Republican President Donald Trump.

In Virginia's hard-fought contest, Democratic Lieutenant Governor Ralph Northam defeated Republican Ed Gillespie. In New Jersey, front-running Democrat Phil Murphy trounced Republican Lieutenant Governor Kim Guadagno to succeed unpopular GOP Governor Chris Christie.

The victors said Tuesday's electoral results had far-reaching repercussions in a sharply divided country.

“Virginia has told us to end the divisiveness, that we do not condone hatred and bigotry,” Northam said.

“The days of division are over. We will move forward,” Murphy said in his own victory speech, invoking Trump by name as he looked headed to a double digit win. Murphy, who earned a fortune at Goldman Sachs before serving as Barack Obama's ambassador to Germany, delivered his address in the same spot as Christie in his 2013 re-election— after Christie won big over his Democratic rival.

The wins in both states are a morale boost to Democrats who had so far been unable to channel anti-Trump energy into success at the ballot box in a major election this year.

“The people are gonna rise up. They're not gonna take what he says and this is not fake news,” said Leanna Barnes, a 76-year-old from East Orange, New Jersey, who voted for Murphy and called his victory a message to the president.

Virginia college student Tamia Mallory said she began paying attention to her state's gubernatorial race when she saw tweets from Trump endorsing Gillespie. That motivated her to examine the race and find out who was running against Gillespie, she said.

“It was kind of an anti-Trump vote,” Mallory said.

Northam, the state's lieutenant governor, repeatedly sought during long months of divisive campaigning to tie Gillespie to the president. His victory was in large part due to the surge in anti-Trump sentiment since the president took office. Democrats said they had record levels of enthusiasm heading into the race in Virginia, a swing-state and the only Southern state Trump lost last year.

Gillespie, meanwhile, sought to keep Trump at a distance throughout the campaign but tried to rally the president's supporters with hard-edge attack ads focused on illegal immigration and preserving Confederate statues. The strategy was criticised by Democrats and some Republicans as race baiting, but drew praise from former Trump strategist Steve Bannon and others as a canny approach in a state that voted for Hillary Clinton last year.

Trump lent limited pre-election support to Gillespie with robocalls and tweets.

In one call, Trump said Gillespie shared his views on immigration and crime and would help “Make America Great Again.” Trump also said Northam would be a “total disaster” for Virginia.

But after Tuesday's loss, Trump suggested that Gillespie hurt himself by not more closely aligning himself with the president.

“Ed Gillespie worked hard but did not embrace me or what I stand for,” Trump said in a tweet after Northam won. He also pointed out that Republicans have won every special election to the US House since he was elected.

Northam's victory is a blow to Republicans, who were hoping that Gillespie could provide a possible roadmap for moderate Republicans to follow in next year's midterm elections. Several Republicans have announced plans to retire next year instead of seeking re-election, and Gillespie loss may prompt more such announcements.

A former White House aide to President George W. Bush and a Washington lobbyist, Gillespie struck a humble tone in his concession speech as he offered support to Northam. Gillespie wiped tears from his eyes while thanking his wife and said the million people who voted for him love Virginia, and so do those who disagree with them.

“And I know they too are rooting for our new governor to succeed because we all love the commonwealth of Virginia,” Gillespie said.

The mood was subdued at Gillespie's gathering at a Richmond-area hotel, with supporters not shocked at the outcome but surprised at how poorly Republicans did. Democrats swept all three of Virginia's statewide races and nearly wiped out Republicans' overwhelming majority in the Virginia House of Delegates on Tuesday. A handful of races that will decide control of the body remaining too close to call.

Gillespie supporter Elsa Smith said Republicans needed to do a better job of appealing to minorities if they want to win future races.

“We are not taking care of the demographics the way we should,” said Smith, an owner of a Spanish translation business.

Democrats were gleeful at Northam's victory party. US Representative Gerry Connolly called Northam the “perfect antidote” to the President.

Donald Trump's least presidential moments so far... Show all 30 1 /30 Donald Trump's least presidential moments so far... Donald Trump's least presidential moments so far... Threatening to shut down Twitter after being fact-checked After the president tweeted that voting by post would be "substantially fraudulent", Twitter attached a warning label to his tweet and referred readers to a site which explained how the claim was "unsubstantiated". Trump then said Twitter was "stifling free speech" and that he may have to shut it down, something which he would not have the power to do AFP/Getty Donald Trump's least presidential moments so far... Flippantly dismissing a serious allegation of sexual assault When author E Jean Carroll accused Trump of raping her, the president responded: “Number one, she’s not my type. Number two, it never happened. It never happened, OK?" AFP/Getty Donald Trump's least presidential moments so far... Insulting the Mayor of London as he landed in London Just before touching down at Stansted Airport for his state visit, Trump took time out to @ the London mayor Sadiq Khan on twitter. He said that Khan has done a "terrible job"as mayor and that he is a "stone cold loser" Reuters Donald Trump's least presidential moments so far... Taking plenty of "Executive Time" The president's official schedule sets aside the hours from 8 to 11am daily for "Executive Time". Further intermittent periods of "Executive Time" are scheduled throughout any given day, ranging from 15 minutes to 3 hours. His duties in these hours have not been officially disclosed, though Axios reports that he spends them watching TV, reading the newspapers and tweeting Getty Donald Trump's least presidential moments so far... Shutdown the government for over a month in an effort to secure funding for his wall With Mexico declining to pay for the wall, the president has faced difficulty in raising the required $5bn at home. Due to his demand that the money for the wall be included in the budget, and Congress's refusal, the government partially shut down on 22 December 2018. It remained shut for over a month, the longest period in history Getty Donald Trump's least presidential moments so far... Joking about the Nazi occupation of France to President Macron In this tweet from 13 November 2018, the president mocks Emmanuel Macron's suggestion of a "true, European army" by invoking the conflict between France and Germany in the world wars Donald Trump's least presidential moments so far... Railing against the Mueller investigation The president has repeatedly claimed that the Mueller investigation into Russian interference in the 2016 election, is a "rigged witch hunt" Reuters Donald Trump's least presidential moments so far... Contradicting a US intelligence report on Russian meddling in the presence of Vladimir Putin In the press conference that followed his landmark meeting with Russian president Vladimir Putin, Trump stated that he saw no reason why Russia would have meddled in the 2016 US election. This contradicted a 2017 report by the US Office of the Director of National Intelligence that found evidence of Russian interference in favour of Trump Getty Donald Trump's least presidential moments so far... Contradicting his contradiction of a US intelligence report on Russian meddling Following furious backlash in the US, the president claimed that he meant to say that he saw no reason why it would not have been Russia who meddled in the 2016 US election. As to why he would have intended to use such bizarre phrasing, he did not comment Reuters Donald Trump's least presidential moments so far... Colouring in the US flag wrong The president coloured in the US flag wrongly during a visit to a children's hospital in Columbus, Ohio. He added a blue stripe where in tradition, and statute, there have been only white and red stripes AFP/Getty Donald Trump's least presidential moments so far... Firing a Secretary of State over Twitter The president announced on Twitter that he was appointing Mike Pompeo as Secretary of State, much to the surprise of then Secretary of State Rex Tillerson Donald Trump's least presidential moments so far... Quoting a catchphrase from a reality TV show when discussing police brutality While addressing the issue of black athletes not standing for the national anthem in protest of police brutality, the president made reference to his catchphrase from reality TV show "The Apprentice": you're fired! Reuters Donald Trump's least presidential moments so far... Calling African nations "S***hole Countries" Ever one for diplomacy, the president reportedly referred to African nations as "s***hole countries". Asked to confirm this when meeting with Nigeria's President Buhari, Trump stated that there are "some countries that are in very bad shape". Reuters Donald Trump's least presidential moments so far... Defending Russian President Vladimir Putin Trump appeared to equate US foreign actions to those of Russian president Vladimir Putin, saying: “There are a lot of killers. You think our country’s so innocent?” Reuters Donald Trump's least presidential moments so far... Asking for people to 'pray' for Arnold Schwarzenegger At the National Prayer Breakfast, Trump couldn’t help but to ask for prayers for the ratings on Arnold Schwarzenegger’s show to be good. Schwarzenegger took over as host of “The Apprentice” — which buoyed Trump’s celebrity status years ago Getty Donald Trump's least presidential moments so far... Hanging up on Australian PM Malcolm Turnbull Early in his presidency, Trump reportedly hung up the phone on Australian prime minister Malcolm Turnbull after the foreign leader angered him over refugee plans. Mr Trump later said that it was the “worst call” he had had so far Getty Donald Trump's least presidential moments so far... The 'Muslim ban' Perhaps one of his most controversial policies while acting as president, Trump’s travel ban targeting predominantly Muslim countries has bought him a lot of criticism. The bans were immediately protested, and judges initially blocked their implementation. The Supreme Court later sided with the administration’s argument that the ban was developed out of concern for US security Getty Donald Trump's least presidential moments so far... Praising crowd size while touring Hurricane Harvey damage After Hurricane Harvey ravaged southeastern Texas, Trump paid the area a visit. While his response to the disaster in Houston was generally applauded, the president picked up some flack when he gave a speech outside Houston (he reportedly did not visit disaster zones), and praised the size of the crowds there AP Donald Trump's least presidential moments so far... 'Little Rocket Man' During his first-ever speech to the United Nations General Assembly, Trump tried out a new nickname for North Korea leader Kim Jong-un: Rocket Man. He later tweaked it to be “little Rocket Man” as the two feuded, and threatened each other with nuclear war. During that speech, he also threatened to totally annihilate North Korea Donald Trump's least presidential moments so far... Attacking Sadiq Khan following London Bridge terror attack After the attack on the London Bridge, Trump lashed out at London Mayor Sadiq Khan, criticising Khan for saying there was “no reason to be alarmed” after the attack. Trump was taking the comments out of context, as Khan was simply saying that the police had everything under control Getty Donald Trump's least presidential moments so far... Claiming presenter Mika Brezinkski was 'bleeding from the face' Never one not to mock his enemies, Trump mocked MSNBC’s “Morning Joe” co-host Mika Brzezinski, saying that she and co-host Joe Scarborough had approached him before his inauguration asking to “join” him. He noted that she was “bleeding badly from a face-lift” at the time, and that he said no MSNBC Donald Trump's least presidential moments so far... Claiming the blame for Charlottesville was on 'both sides' Trump refused to condemn far-right extremists involved in violence at 'the march for the right' protests in Charlottesville, even after the murder of counter protester Heather Heyer AP Donald Trump's least presidential moments so far... Retweeting cartoon of CNN being hit by a 'Trump train' Trump retweeted a cartoon showing a Trump-branded train running over a person whose body and head were replaced by a CNN avatar. He later deleted the retweet Donald Trump's least presidential moments so far... Tweeting about 'slamming' CNN Trump caught some flack when he tweeted a video showing him wrestling down an individual whose head had been replaced by a CNN avatar. Trump has singled CNN out in particular with his chants of “fake news” Donald Trump's least presidential moments so far... Firing head of the FBI, James Comey Trump’s firing of former FBI Director James Comey landed him with a federal investigation into Russia’s meddling in the 2016 election that has caused many a headache for the White House. The White House initially said that the decision was made after consultation from the Justice Department. Then Mr Trump himself said that he had decided to fire him in part because he wanted the Russia investigation Mr Comey was conducting to stop Getty Donald Trump's least presidential moments so far... Not realising being president would be 'hard' Just three months into his presidency, Trump admitted that being president is harder than he thought it would be. Though Trump insisted on the 2016 campaign trail that doing the job would be easy for him, he admitted in an interview that living in the White House is harder than running a business empire Reuters Donald Trump's least presidential moments so far... Accusing Obama of wiretapping him Trump accused former president Barack Obama of wire tapping him on twitter. The Justice Department later clarified: Obama had not, in fact, done so Reuters Donald Trump's least presidential moments so far... Claiming there had been 3 million 'illegal votes' Trump was never very happy about losing the popular vote to Hillary Clinton by 2.8 million ballots. So, he and White House voter-fraud commissioner Kris Kobach have claimed that anywhere between three and five million people voted illegally during the 2016 election. Conveniently, he says that all of those illegal votes went to Clinton. (There is no evidence to support that level of widespread voter fraud.) Donald Trump's least presidential moments so far... Leaving Jews out of the Holocaust memorial statement Just days after taking office, Trump’s White House issued a statement on International Holocaust Remembrance Day, but didn’t mention “jews” or even the word “jewish” in the written statement Getty Donald Trump's least presidential moments so far... Anger over Inauguration crowd size Trump’s inauguration crowd was visibly, and noticeably, smaller than that of his predecessor, Barack Obama. But, he really wanted to have had the largest crowd on record. So, he praised it as the biggest crowd ever. Relatedly, Trump also claimed that it stopped raining in Washington at the moment he was inaugurated. It didn’t, the day was very dreary Reuters

“This is a comprehensive victory from the statehouse to the courthouse. Thank you, President Trump,” Connolly said.

The Democratic victories are another sign of Virginia's shift toward a more liberal electorate. Democrats have won every statewide election since 2009 and now have won four out of the last five gubernatorial contests. Northam, pediatric neurologist and Army doctor, banked heavily during the campaign on his near-perfect political resume and tried to cast himself as the low-key doctor with a strong Southern drawl as the healer to Trump's divisiveness.

What do last night's results mean for the US?

Democrats swept Virginia and New Jersey's governor's races, incumbents reigned supreme in several big-city mayoral races and voters in Maine said they wanted to join 31 other states in expanding Medicaid under the Affordable Care Act.

A rundown of the top races around the country on Tuesday:

Two governors

Voters in two states picked replacements for their term-limited governors — Democrat Terry McAuliffe in Virginia and Republican Chris Christie in New Jersey — in contests seen as an early referendum on the presidency of Donald Trump. In swing state Virginia, Democratic Lieutenant Governor Ralph Northam defeated Republican Ed Gillespie. In New Jersey, front-running Democrat Phil Murphy overcame Republican Lieutenant Governor Kim Guadagno.

The stakes were high as both parties sought momentum ahead of next year's midterm elections. Democrats haven't won any special elections for Congress this year and the next Virginia governor will have a major say in the state's next round of redistricting, when Congressional lines are drawn. Republicans were looking for a boost as their party is beset by intra-party turmoil between Trump and key Republicans in Congress.

Big-city mayors

Democrat Bill de Blasio won a second term as mayor of heavily Democratic New York City. He easily defeated Republican state lawmaker Nicole Malliotakis and several third-party candidates.

In Boston, Mayor Marty Walsh won a second four-year term by beating City Councillor Tito Jackson after a low-key campaign.

Detroit Mayor Mike Duggan won a second four-year term by defeating state Senator Coleman Young II, whose father was the city's first black mayor. Duggan was first elected after a state-appointed manager filed for Detroit's historic bankruptcy.

Nearly a dozen candidates are competing to succeed term-limited Atlanta Mayor Kasim Reed. If the top vote-getter doesn't win more than 50 percent, the race would require a runoff on 5 December.

In Seattle, former US Attorney Jenny Durkan took a strong early lead in the race for mayor. Voters were choosing between Durkan and urban planner Cary Moon to replace former Mayor Ed Murray, who resigned earlier this year amid sexual abuse allegations. Ballot counting in the all mail-in election will continue over the next several days.

Charlotte, North Carolina, is getting its sixth mayor since 2009. Mayor Pro Tem Vi Lyles, a Democrat, beat Republican City Councilman Kenny Smith.

Medicaid

Maine voters approved a measure allowing them to join 31 other states in expanding Medicaid under the Affordable Care Act. The referendum represented the first time since the signature health bill of former President Barack Obama took effect that the question of expansion was put before U.S. voters. Maine's Republican governor had vetoed five attempts to expand the program.

Utah's congressional seat

The Republican mayor of the Mormon stronghold of Provo, Utah, won a special election to replace US Representative Jason Chaffetz, who resigned earlier this year. In an expected victory in the heavily Republican congressional district, John Curtis beat Democrat Kathryn Allen and third-party candidate Jim Bennett.

Philadelphia District Attorney

Philadelphia's next District Attorney is Larry Krasner, a liberal Democrat who vows to end mass incarceration and the death penalty. He replaces Democrat Seth Williams, who was sentenced to prison last month for accepting a bribe.

Control of Washington

Democrat Manka Dhingra took an early lead in a state Senate race that will determine whether the Washington state Senate will remain the only Republican-led legislative chamber on the West Coast. If the seat flips to Democrats , Washington will join Oregon and California with total Democratic rule in both legislative chambers and the governor's office. Under the state's vote-by-mail system, ballots just need to be postmarked or dropped off by Tuesday, which means that final results may not be known for days.