All 140 seats in the General Assembly are on the ballot, but much of the battle has focused on suburban districts in Northern Virginia, Richmond and Hampton Roads, where voters can swing left or right.

“Virginia has the best Unemployment and Economic numbers in the history of the State. If the Democrats get in, those numbers will go rapidly in the other direction. On Tuesday, Vote Republican!” Trump tweeted Monday night, one of a series of presidential proclamations on the state.

“We were also named the best state for business this year. Thanks for noticing what Democratic leadership is doing for our Commonwealth!” Democratic Gov. Ralph Northam tweeted in reply.

Trump is deeply unpopular in Virginia, and he made no visits there to boost GOP candidates. When Vice President Pence attended a campaign rally in Virginia Beach on Sunday, the Democratic Party of Virginia promoted the appearance.

Republicans are defending thin majorities of 20 to 19 in the Senate and 51 to 48 in the House of Delegates, with one vacancy in each chamber. If Democrats can take control, they could consolidate power for the first time in 26 years and work with Northam to enact legislation long blocked by Republicans.

Those include gun control, protections against discrimination based on sexual orientation, a higher minimum wage and passage of the Equal Rights Amendment. As the only former Confederate state that went for Hillary Clinton in 2016, and with its urban and suburban areas becoming increasingly diverse, Virginia is seen by Democrats as an important place to plant the flag against Trump’s Republican Party.

Whoever controls the General Assembly will oversee redistricting after next year’s census — influencing politics for a decade to come.

“Proud to endorse an outstanding group of Virginia Democrats in Tuesday’s election — candidates who’ll not only advance the causes of equality, justice, and decency, but help ensure that the next decade of voting maps are drawn fairly. That’s good policy — and good for our politics,” former president Barack Obama tweeted.

Voters will also decide a host of local races, electing successors to outgoing board of supervisors chairs Sharon Bulova (D-Fairfax) and Corey A. Stewart (R-Prince William), among others; choosing supervisors, prosecutors, school board members and sheriffs across the state; and endorsing or rejecting millions in bond issues for schools, transportation and public safety projects.

In the state legislative races, expectations are so high that coming up short of a majority in either chamber would raise questions about the Democratic Party’s fitness to take on Trump in 2020.

GOP candidates warn that new liberal Democrats are out of step with traditional Virginia values and will ruin the state’s business-friendly climate. Many suburban Republican candidates have attempted a difficult balancing act, posing almost like centrist Democrats for much of the summer — including blue campaign signs and literature that emphasized gun safety and health care without mentioning party affiliation — but lashing out against “socialists” and abortionists in the final weeks.

Tuesday’s elections will cap a political year that has obliterated quaint notions of a “Virginia Way” of bipartisan civility.

Democrats entered 2019 with tremendous momentum after making big gains in contests for the House of Delegates and Congress. After a federal court ruled that several of the state’s House districts had been racially gerrymandered, judges approved an electoral map that redrew 26 districts — boosting Democrats’ chances by shifting six Republicans into blue-leaning territory.

In late January, though, Democratic legislators and Northam made clumsy comments defending a bill that would have loosened restrictions on late-term abortions. Conservatives across the country erupted with charges of infanticide — something Northam, a pediatric neurologist, called “disgusting.”

Days later, a racist photo surfaced from Northam’s 1984 medical school yearbook page, depicting one person in blackface and another in Ku Klux Klan robes. Northam initially took responsibility for the photo, and most in his party called on him to resign.

But he quickly disavowed the photo, although he admitted darkening his face for a dance contest later that same year, and refused to step down.

Within days, the state’s two other top Democrats were also mired in scandal: Lt. Gov. Justin Fairfax was accused by two women of separate sexual assaults in the early 2000s, both of which he denies, and Attorney General Mark R. Herring admitted that he, too, had darkened his face for a party in college in 1980.

Republicans aimed to depict Democrats as chaotic, scandal-ridden baby killers, and themselves as pragmatic centrists.

On May 31, though, tragedy disrupted state politics when a gunman killed 12 in Virginia Beach. Amid a public outcry for action, Democrats rallied around Northam, who summoned the General Assembly to a special legislative session in July to consider gun restrictions.

Republicans who control the legislature accused Democrats of cynical politics and adjourned the session after 90 minutes without debating a single bill. Instead, they referred all legislation to a state crime commission.

That was a risky move for Republicans — a recent Washington Post-Schar School poll found that gun policy is the top issue for a majority of Virginia voters. While those voters split evenly among Democrats and Republicans, even bigger majorities said they favor some form of gun control legislation.

Polls also consistently showed that most Virginians are happy with the job Northam is doing, defusing the scandal issue for Republicans. The governor’s fundraising has continued to lag behind, but he returned to the campaign trail — albeit without the usual gubernatorial fly-around in the home stretch. Former governor Terry McAuliffe (D) picked up some of the slack, raising money and making campaign appearances.

After several other states enacted harsh abortion restrictions, that topic lost some of its potency in Virginia, where suburban voters are leery of encroaching on a woman’s right to choose.

Republicans in some districts have tried to revive the late-term abortion issue, hoping to energize their base. The Democratic-driven impeachment effort is also revving up the GOP, some Republicans said.

Turnout is the most crucial factor Tuesday. This is an “off-off year,” without statewide or federal races on the ballot to stir up voter interest. Turnout in such years in Virginia is typically very low — usually less than 30 percent. Democrats are hoping that anti-Trump fervor will get their numbers up, as it has done since 2016, and they have cranked up celebrity endorsements for good measure, including visits from actors Alec Baldwin and Kerry Washington.

Democrats said they knocked on 2.4 million doors across the state. Republicans declined to disclose their numbers.

As Pence rallied Republicans in Virginia Beach over the weekend, Democrats brought former vice president Joe Biden, a 2020 presidential contender, to a rally in Northern Virginia. Sen. Bernie Sanders of Vermont (I-Vt.) was to stump Monday for Del. Lee Carter (D-Manassas), the only self-described socialist in the legislature. Carter faces a challenge from Republican Ian Lovejoy.

National Democratic groups promoting abortion rights, LGBT rights, gun control and unions dispatched their national leadership to lead canvassing kickoffs in the final three days.

With turnout uncertain and with the new court-ordered boundaries that affect districts around Richmond and Hampton Roads, election officials are on guard for possible voter confusion and what could be a number of extremely close races.

In Northern Virginia, Democrats see their best pickup opportunity in the state Senate seat being vacated by retiring Sen. Richard H. Black (R-Loudoun), a social conservative who had been able to hang on despite a changing district. Del. John Bell (D-Loudoun) has raised $2.6 million for that open seat, compared with $1.4 million by Republican Geary Higgins. Democrats also have targeted Del. Tim Hugo (R-Fairfax), a member of the GOP leadership and the last Republican House member in Northern Virginia, who faces Dan Helmer.

Republicans, meanwhile, focused on unseating several Prince William delegates swept into office two years ago on an anti-Trump wave, including the state’s first two Latina legislators, Hala Ayala and Elizabeth Guzman, and Danica Roem, Virginia’s first transgender elected official. But fundraising in those races has heavily favored Democrats.

One of the most competitive House races is a rematch — Del. Wendy Gooditis (D-Clarke) vs. former Republican delegate Randy Minchew. She unseated him in 2017, when Minchew’s own sister-in-law voted against him to demonstrate her disdain for Trump.

In the Richmond suburbs, two freshman Republican state senators are trying to fend off Democratic challengers in districts carried by Hillary Clinton in 2016 that have tilted bluer since. Sen. Glen H. Sturtevant Jr. (R-Richmond) faces Democrat Ghazala Hashmi, while Sen. Siobhan S. Dunnavant (R-Henrico) is trying to fend off Del. Debra H. Rodman (D-Henrico). The Dunnavant-Rodman contest is on track to be the state’s most expensive, with Dunnavant raising $2.5 million and Rodman $2.8 million.

In a rural-suburban district that has remained red under Trump, Democratic challenger Amanda Pohl hopes to capitalize on a string of election-year controversies surrounding freshman Sen. Amanda F. Chase (R-Chesterfield), who wore a gun on her hip on the Senate floor, cussed out a Capitol police officer over a parking space and was ousted from her local GOP committee. But both parties say Chase’s poll numbers rose after the attention.

The most prominent House race in the region pits Speaker Kirk Cox (R-Colonial Heights) against Sheila Bynum-Coleman (D). The speaker, the state’s most powerful Republican, must compete in a redrawn district. The map swung from heavily favoring Republicans to tilting slightly blue. The symbolic value of the race has helped Bynum-Coleman nearly keep pace with Cox’s fundraising, $1.4 million to his $1.8 million.

Other hard-fought races in the region pit Del. Schuyler T. VanValkenburg (D-Henrico) against GayDonna Vandergriff (R); Democrat Rodney Willett vs. Republican Mary Margaret Kastelberg; and Del. Roxann L. Robinson (R-Chesterfield) vs. Democrat Larry Barnett. Two years ago, Barnett lost to Robinson by just 128 votes.

In Hampton Roads, the most-watched race is a rerun: Del. David E. Yancey (R-Newport News) faces Democrat Shelly Simonds (D) two years after their 2017 contest resulted in a tie, which was decided by a random drawing live on national television.

Del. Chris Jones (R-Suffolk), chairman of the powerful House Appropriations Committee, is trying to fend off Clinton Jenkins in a redrawn district that heavily favors Democrats.

Several Virginia Beach races could be pivotal in determining the balance of power and will test the potency of the gun control issue. Freshman Del. Kelly K. Convirs-Fowler (D-Virginia Beach) is in a tight race in a heavily military district against Republican challenger Shannon Kane; Del. Glenn R. Davis Jr. (R-Virginia Beach) faces Democrat Karen Mallard; and Del. Christopher P. Stolle (R-Virginia Beach) is running against Democrat Nancy Guy.

That area’s two Senate seats are also competitive. Del. Cheryl B. Turpin (D-Virginia Beach) faces Republican Jen Kiggins for an open seat vacated by retired senator Frank Wagner (R-Virginia Beach), and Sen. William R. DeSteph Jr. (R-Virginia Beach) is trying to turn back a well-funded challenge by Democrat Missy Cotter Smasal.