ASHBURN, Va.—Democrats are banking on this affluent, fast-growing suburb of Washington, D.C., to help the party claim simultaneous control of Virginia’s legislative and executive branches for the first time in a quarter-century.

Virginia is one of just four states holding state legislative elections in November, and the showdown there could offer clues on party strength in suburban swing districts for next year’s presidential election.

The political divisions in Virginia are close enough to make the overall outcome a tossup. The GOP is defending a single-seat majority in the 40-member Senate and a three-seat margin in the 100-member House of Delegates. Both chambers have one vacant seat.

A Democratic sweep would put Gov. Ralph Northam’s recent gun-control proposals back in play, while putting his party in charge ahead of political redistricting after the 2020 census. Republicans are trying to retain divided government in the state to block Democrats’ efforts on firearms and other issues.

Democrat John Bell, a Virginia House member running for a state Senate seat held by a retiring Republican, recently went door to door on a road lined with stately homes and manicured lawns here, pitching his commitment to pass tougher gun laws.

He found a possible convert in Annette Best, a Republican voter unnerved by mass shootings, including one that left 12 dead in Virginia Beach in May.

“I don’t know how many more shootings have to happen for us to figure out that there’s a problem,” said Ms. Best, a 53-year-old financial-services manager.

Mr. Bell, a retired Air Force officer, framed a statewide win as crucial to advancing Democratic objectives such as gun-control efforts and protecting women’s reproductive rights. “Those are not going to go anywhere unless we take the majority,” Mr. Bell said.

Supporters for his Republican opponent, Loudoun County Supervisor Geary Higgins, were out the same Sunday knocking on doors in a modern subdivision in the town of Lovettsville. The GOP candidate is focused on issues he says are key to a growing region—including transportation and school funding—but also worries about a Democratic majority passing legislation that he says would boost business regulations and hurt the state economically.

“Certainly, the local issues are paramount in importance, but you have to look beyond that,” Mr. Higgins said. “And definitely I am concerned about the Senate rolling over to the Democrats.”

Republican candidate Geary Higgins canvassed with staffers and volunteers in Chantilly, Va., on Thursday. PHOTO: GREG KAHN FOR THE WALL STREET JOURNAL

Virginia Democrats made big strides in 2017, picking up 15 seats in the House. Breaking through in November would hand the party a new trifecta state—meaning control of both branches of the Legislature and governor’s office—while further chipping away at the GOP’s sizable advantage in statehouses around the U.S.

Virginia has turned increasingly Democratic, driven by population growth near Washington. Democrat Hillary Clinton carried the state in 2016 by 5.3 percentage points. Last year, U.S. Sen. Tim Kaine coasted to re-election, and Democrats picked up a majority of the 11 U.S. House seats.

Democrats are competing for more seats in both Virginia chambers this fall, according to the nonpartisan Virginia Public Access Project. They are getting help from a 2018 federal court ruling that found boundaries in 11 House districts were racially gerrymandered, causing more than two dozen to be redrawn, said Christopher Newport University political scientist Quentin Kidd.

Turnout will be key. “I see an uptick in Republican engagement. I’m not sure there’s enough to counteract that level of Democratic enthusiasm,” Mr. Kidd said.

Democrats promise swift policy changes if they prevail. “Day One, we’re going to pass common-sense gun restrictions, we’re going to raise the minimum wage,” said Terry McAuliffe, a Democratic former governor who has assumed a high profile on the campaign trail, months after Mr. Northam faced calls to resign when a racist photo from his medical-school yearbook page surfaced in February.

The state Republican Party is warning about the consequences of a Democratic takeover in the state capital, Richmond. “Right away, taxes would go up, right-to-work law would probably become history nearly instantaneously, abortion laws would basically go to New York or California levels,” said state GOP Executive Director John Findlay. “And then gun rights would also be severely curtailed.”

Mr. Northam proposed several new gun laws, including universal background checks and bans on high-capacity magazines, after the Virginia Beach shooting. He called a special session, but Republican majorities in both chambers quickly adjourned without considering any measures, opting instead to direct the Virginia State Crime Commission to conduct a review.

SHARE YOUR THOUGHTS

How do you think Virginians will vote in the coming election? Join the conversation below.

The gun debate has galvanized national players on both sides. Everytown for Gun Safety, an advocacy group backed by Michael Bloomberg, said it plans to spend $2.5 million to help Democrats such as Mr. Bell flip the General Assembly. The Virginia-based National Rifle Association donated $200,000 to a GOP political-action committee, and the group says it is working to mobilize members to oppose gun-control measures.

Republicans are focused on many of the freshmen Democrats who rode the 2017 wave into office. “There’s still a clear path to majority in the House on the Republican side,” said Mr. Findlay.

In the state Senate, Democratic incumbents are defending just four seats against GOP opponents, compared with 15 Republican-held districts where Democrats are running. A departing Republican in Northern Virginia created the open Senate race in that district, which stretches from semirural farmland to dense suburbs west of Washington.

Republican voter Bryan Elliott, 60, told Higgins campaign staffer Rob Middleton he could count on his support because he shares the candidate’s conservative views. But independent Bruce McMillan, 64, an information security engineer, said he would probably vote for Mr. Bell as a protest against President Trump.

Mike Ruttle, 49, an IT project manager, said he backs Mr. Higgins because he hopes divided power will push both parties toward nuanced solutions. “Where do we find reasonable approaches to solving real problems?” he asked.

Write to Scott Calvert at [email protected] and Jon Kamp at [email protected]

(Click here for link to article on WSJ.com)