The Democrat Ralph Northam won a decisive victory on Tuesday as the Republican party suffered its first major electoral defeat since Donald Trump took the White House.

With 88% of precincts reporting, Northam had bested Republican Ed Gillespie by a margin of 53% to 46% to win Virginia’s governorship, in a wave election that saw a Democratic landslide in the state.

Virginia elects first transgender person to US state legislature Read more

The race had long been framed by Democrats as a referendum on Trump, who tweeted copiously about it but did not appear on the campaign trail with Gillespie. Northam ran a television ad in which he called Trump a “narcissistic maniac” in the primary and then often tried to put the race in a broader context. He told the Guardian in an interview the night before the election: “Virginia is a bellwether for this country and the world.”

In contrast, while Republicans ran television ads focused on Trump-associated issues such as Latino gangs and Confederate monuments, Gillespie stayed focused in campaign appearances on bread-and-butter issues such as economic development and taxes.

After Gillespie’s concession speech, Republican congressman Scott Taylor described the election as “a referendum on the administration” and said Trump’s “divisive rhetoric prompted and helped usher in a very high Democratic turnout in Virginia”. He expressed his shock that unknown “no-name” Democrats had won state legislative seats despite running weak campaigns.

Northam, the state’s lieutenant governor, managed to win despite a campaign that was heavily criticized by many Democrats in recent weeks for its halting response to Republican attacks and the backlash to a campaign ad run by a supportive Super Pac that featured a man in a pickup truck with a Gillespie bumper sticker and Confederate flag chasing after Hispanic and Muslim youths.

Despite those pitfalls, voters swarmed the polls in well-educated parts of northern Virginia that have swung heavily Democratic in recent years, where they overwhelmingly supported Northam. Exit polls showed the Democratic candidate outperforming Hillary Clinton in key demographics including female voters and college graduates.

Nor did Northam suffer any significant dropoff among African American voters, a key demographic in the state. Herbert Williams Jr, a 46-year-old African American business owner and navy veteran, said that he supported Northam in an attempt to combat “extremism”. In his opinion, Virginia’s election would “penetrate across the country as a referendum against extremism”.

However, Gillespie’s embrace of a Trump-like message struck many as inauthentic. A former chair of the Republican national committee and George W Bush White House staffer, the Republican nominee was a pillar of the Republican establishment. Andy Surabian, a close ally of Steve Bannon and senior adviser to the Great America Pac, said Gillespie was hurt because he came across as inauthentic.

“Ed Gillespie proved tonight that the way forward for the Republican party is to run authentic candidates who can believably connect with voters on issues they care about like illegal immigration,” Surabian said.

Trump also rushed to blame the losing Republican. In a tweet from his foreign trip in South Korea, the president wrote: “Ed Gillespie worked hard but did not embrace me or what I stand for. Don’t forget, Republicans won 4 out of 4 House seats, and with the economy doing record numbers, we will continue to win, even bigger than before!”

Gillespie had pushed towards more populist positions after nearly suffering an embarrassing primary loss to Corey Stewart, a local elected official who campaigned on the issue of Confederate monuments and his steadfast support for Trump.

Taylor told the Guardian that Trump’s tweet was “profoundly wrong” and that “the results would have been a lot worse if Ed wasn’t the candidate, a lot worse.” Instead, he emphasized that candidates should be “authentic” and be explicit about when they agreed with Trump and when they didn’t.

Chris Hurst, who lost girlfriend in live TV shooting, beats NRA candidate in Virginia Read more

Gillespie’s results lagged far behind those of two other statewide candidates from his party, who were on the ballot for lieutenant governor and attorney general. However, Democrats held on to both positions as Justin Fairfax became the second African American to win statewide office in the commonwealth and the attorney general, Mark Herring, won re-election to a second term.

Gillespie’s poor performance was a boost for local Democrats, who picked up at least 14 seats in the state house of delegates, potentially giving them a chance to flip the chamber. Among the winners was Danica Roem, who became the first transgender woman elected to a state legislative seat in American history, besting the conservative firebrand Bob Marshall in the outer suburbs of Washington DC.

Democrats did well in other key races on Tuesday night as well. In New Jersey, the Democrat Phil Murphy romped to victory against the state’s incumbent lieutenant governor, Kim Guadagno, in a race that national Republicans had long written off. In neighboring New York, Mayor Bill de Blasio won re-election as expected.

20 Dems for 2020: who might the Democrats field next time around? Read more

In Maine, a referendum pushed by Democrats to expand Medicaid in the state passed. The Republican governor, Paul LePage, had previously vetoed six bills passed in the state legislature to expand the healthcare program for low-income Americans under the provisions of Obamacare. In Washington, Democrats won a special election for the state senate that gives them total control of the state. Democrats also won competitive mayoral races in Charlotte, North Carolina, St Petersburg, Florida, and Manchester, New Hampshire.

The big Democratic night bodes well for 2018 as signs of backlash against Trump, whose approval rating is mired under 40% grow. Republicans currently have a 24-seat majority in the House of Representatives. When asked if his party could hold on to the House of Representatives if Trump’s rhetoric and tweets remained the same in the next year, Taylor said “that’s an interesting question. I think it will handicap the ability for that to happen.”