Democrat Ralph Northam swept to victory in the race for Virginia governor on Tuesday in a night of political retaliation against President Trump that also saw a Democratic gubernatorial win in New Jersey.
Northam's victory sketched out a path that Democratic strategists hope other candidates can follow in next year's contest for control of Congress.
He piled up big margins in the suburbs of northern Virginia, the most populous and voter-rich area of the state, where animosity toward the president runs deep. At the same time, Northam, the lieutenant governor, also fared better than many Democrats have in more rural areas, preventing the Republican candidate, Ed Gillespie, from running up the score in the southern and western areas of the state, where Trump trounced Hillary Clinton one year ago.
Democrats also picked up more than a dozen seats in the Virginia House of Delegates, putting them close to a majority in the lower house with several races undecided — a result that few political analysts or state Democrats had thought likely.
The Democratic nominee in New Jersey, Phil Murphy, had been expected to win, but the Virginia race appeared closer in preelection polls. The results generated joy among Democrats who saw victories in both states as critical heading into the 2018 midterm elections.
Also drawing attention on Tuesday were races for mayor of New York and Boston. In the mayoral races, incumbent Democrats Bill de Blasio and Martin Walsh were easily reelected.
In Washington state, Democrat Manka Dhingra, a King County prosecutor, led her Republican opponent in early returns in a hotly contested state Senate race that could flip the upper house to Democrats, creating an unbroken line of blue in West Coast legislatures and governors' offices. Washington conducts elections entirely by mail, so it may be several days before a winner is confirmed.
And in Maine, a referendum victory for a measure to expand Medicaid could point to a way forward on healthcare for liberal activists in states with Republican governors.
Northam, a pediatric neurologist, withstood a hammering from Gillespie that centered on divisive issues including Latino gangs, sanctuary cities, Confederate statues and restoring voting rights to felons — all appeals aimed at persuading Trump supporters to turn out for a candidate who had long been an establishment Republican.
Northam's focus was less heated as he promised to continue the economic gains the state has seen under the current Democratic governor, Terry McAuliffe, and expand healthcare. But he also regularly criticized Trump, making the president an unseen but dominant figure in the race.
Trump did not campaign with Gillespie but offered his support in tweets, including several sent before dawn on election day.
Shortly after the race was called for Northam, however, the president distanced himself from Gillespie.
Contrary to the president's suggestion, however, the results across Virginia provided signs that Democrats had managed to turn anti-Trump sentiment into tangible results. Several counties where Democrats must succeed reported record nonpresidential turnout hours before the polls closed, even though a hard rain fell much of election day.
Among the party's victorious legislative candidates was Danica Roem, a former reporter seeking to be the first transgender state delegate. She defeated Republican Robert Marshall, a longtime legislator who had sponsored anti-LGBT measures and refused to refer to Roem as "she."
The elections were wedged between a presidential contest whose reverberations are still being felt in both parties, and the 2018 elections, when control of the Republican-held House and Senate are at stake. Those elections would normally be seen as an up-or-down vote on the president, but in this fraught political environment the 2017 elections took sharper focus.
For Gillespie, Tuesday was a rerun of his 2014 loss to Sen. Mark Warner. That time, Gillespie's stronger-than-expected showing — he lost by 1 point — made him the front-runner for the nomination for governor, which he secured after a contentious race against Corey Stewart, who was once Trump's state campaign manager.
Democrats faced a greater risk of embarrassment if they had lost: Hillary Clinton won Virginia by 5 points in 2016, the third straight presidential victory for the party in the state. And Democrats had the relative luxury of running against an unpopular president in a year-after election usually won by the party opposed to the just-elected president.
As the candidates sought bragging rights, they also plumbed the answers for dilemmas faced by both major parties as they head into the brawl for control of Congress in 2018.
Will Trump voters turn out to bolster other Republican candidates as they did the president himself, or is their loyalty limited? Can Democrats harness their base's anger at the president without being consumed by it?
The results suggested difficulty for Republicans and optimism for Democrats, although at this point questions remain whether the depth of the victory can be replicated when battles rage in multiple states next year.
The national importance of the Virginia race was underscored before dawn on election day, when Trump, traveling in South Korea, launched three tweets on behalf of Gillespie and sharply critical of Northam.
"Ralph Northam will allow crime to be rampant in Virginia. He's weak on crime, weak on our GREAT VETS, Anti-Second Amendment and has been horrible on Virginia economy," Trump said, offering no evidence for the charges. "Vote Ed Gillespie today. Ed Gillespie will totally turn around the high crime and poor economic performance of VA. MS-13 and crime will be gone. Vote today, ASAP!"
As Northam, an Army veteran, has often reminded Virginia voters, the state's unemployment rate in September was 3.7%, below the 5.4% when Northam became lieutenant governor. While crime rose in Virginia from 2015 to 2016, the incidence of serious crimes remains far below the national average in almost all categories, according to FBI records.
Yet Northam's effort had been all but drowned out for weeks by a fierce assault from Gillespie on issues meant to inspire turnout by the voters who are more naturally allied with Trump.
The race at times echoed the presidential contest in a state won last year by Clinton: a Republican willing to employ brash tactics against a Democrat so low-key that his allies worried voters might respond in kind.
Former President Obama hit that concern hard in a mid-October visit to Richmond intended to encourage turnout by African American voters.
"Elections matter. Voting matters," he told thousands of supporters. "You can't take anything for granted. You can't sit this one out."
The state's airwaves blared with advertisements until the last minute, as candidates sought to convince a narrowing number of undecided voters.
"Virginia will be the most important bellwether of what the party is doing since 2016," said Keith Brannum, the campaign manager for Democrat Elizabeth Guzman, a social worker making her first run for office in one of several highly contested House of Delegates seats. With almost all of the vote counted, she was nearly certain to defeat a veteran Republican.
"It will be the test of whether the enthusiasm for Democrats can be translated into votes, and translated into an electoral coalition."
8:35 p.m.: This story was updated with information on early returns in a Washington state race.
7:35 p.m.: This story was updated with results in additional races.
6:40 p.m.: This story was updated with additional results and analysis.
5:20 p.m.: The story was updated with victories by Democratic candidates in New Jersey and Virginia.