Update: Ralph Northam (D) has won the Virginia governor’s race, according to calls by multiple outlets.

Original post: The most closely contested governor’s election of the Trump era so far is here. Voters in Virginia will cast their ballots for either Democrat Ralph Northam or Republican Ed Gillespie Tuesday, in a race that could have major implications for both parties in next year’s midterm elections. Polls have now closed in the state.

Polling has shown Northam, the current lieutenant governor, and Gillespie, a longtime Republican operative and lobbyist, in a close race, with Northam generally holding a slight edge in averages and being viewed as the favorite.

Still, Democrats have been exceedingly nervous about how this race will turn out, in part because of Northam’s perceived lack of charisma, in part because Virginia polls overstated Democratic leads in a pair of recent high-profile elections, and in part because Gillespie has been hammering Northam on culture war issues like immigration and Confederate monuments.

But there’s more at stake in the state than just the governorship — all 100 seats in Virginia’s House of Delegates will be on the ballot too. Republicans currently hold a 66-34 majority in the chamber, a majority that has hamstrung the efforts of Democratic Gov. Terry McAuliffe to pass sweeping legislation. (The state Senate, which Republicans control much more narrowly, won’t be up for election again until 2019.)

More broadly, Democrats have hoped that Donald Trump’s unpopular presidency could energize their votes and help deliver them down-ballot gains in governors’ mansions, congressional, and state House races across the country. Virginia’s elections today will be a major test of whether that’s actually happening.

The vote count will be updated below and at this link:

The governor’s race looks closer than Democrats hoped it would be

Virginia is one of the few swing states in which Hillary Clinton improved on Barack Obama’s 2012 margin of victory — she beat Trump by about 5 points. It’s also a state where Democrats have long held both US Senate seats, and where there is an incumbent Democratic governor with pretty strong approval ratings (McAuliffe, who was elected in 2013).

Incumbent governors are not permitted to run for reelection in Virginia, though, so Democrats needed a new nominee. The choice of the state party establishment was Ralph Northam, who was a US Army doctor and then a pediatric neurologist before he entered politics to be a state senator and then lieutenant governor. This would traditionally be considered a strong résumé for a politician, but Democrats have worried that he hasn’t generated enough excitement among their base voters.

Republicans, meanwhile, nominated Ed Gillespie, a longtime Republican operative and lobbyist who chaired the Republican National Committee, ran the Virginia Republican Party, and worked in George W. Bush’s White House. Gillespie was the party’s nominee for a US Senate race in 2014, and he ended up coming shockingly close to defeating the incumbent Democrat Mark Warner in a race that few expected would be close.

Gillespie is not an outsider candidate in any way, shape, or form — biographically, he’s the anti-Trump. And yet he’s adopted an extremely Trumpy campaign strategy. In a flurry of ads, he’s attempted to tie Northam to the international gang MS-13 on the thinnest of policy pretexts. (Northam once voted against a Virginia law to officially ban “sanctuary cities” — but Virginia doesn’t even have any sanctuary cities, as Dara Lind explains.) He’s also attacked Northam for proposing to take down some monuments to Confederate generals.

Northam, meanwhile, has attempted to run a more traditional jobs- and economy-focused campaign, while portraying Gillespie as a corrupt lobbyist who represents special interests. It’s a strategy that does appear to have kept him in the lead in most polls throughout the race. Still, most recent polls show his lead in the low single digits, which is a bit too close for the comfort of Democrats still traumatized by the 2016 outcome.

Another thing giving Democrats heartburn is that in both the 2013 governor’s race and the 2014 US Senate race, polls overestimated Democrats’ support. That was particularly true in the latter case, where the GOP nominee — Gillespie — lost by less than a point despite trailing in polls by 10. The flub raised questions about whether pollsters of the state were properly sampling rural white voters. But it should be noted that the polls of the state’s presidential race in 2016 were right on target.

Overall, though, the race’s outcome will be important in influencing the strategies of Democratic and Republican candidates across the country in 2018. If Gillespie pulls off the upset, expect many more GOP challengers to follow his lead and fully embrace Trumpist issues — and expect much more Democratic hand-wringing of how best to respond. But if instead it’s a great night for Democrats — say, if Northam pulls out a strong victory and his party makes significant gains in the state House — it will likely be Republicans who panic.