National gun control groups are pouring money into Virginia ahead of the state's November legislative elections, seeking to energize voters frustrated by the way Republican lawmakers shut down a special session on gun violence called in the wake of a deadly mass shooting in Virginia Beach this spring and hoping to score a win in what some say is a bellwether for next year's national races.

According to recent polling, gun violence is the most important issue to Virginia voters heading into next month's election. And with all 140 seats up for grabs in the state legislature next month, the stakes could not be higher for either side: House Republicans, who lost 15 seats in 2017 but eeked out a razor-thin majority, are eager to claw back some of those flipped districts, while Democrats are hoping to build on the state's decided leftward shift in recent years and capture both chambers of the General Assembly for the first time since the 1990s.

Republicans currently hold a one-seat majority in the House of Delegates and the state Senate, with a vacancy in each chamber.

Gun policy is teed up to be a defining issue: Seventy-five percent of Virginians say it is "very important," more than those who say the same about education , health care or President Donald Trump, according to a recent Washington Post-Schar School poll.

And the bloc of voters who say gun policy is an important issue is split almost evenly between Democrats and Republicans, suggesting that both sides are animated around the debate.

But it's not clear how that enthusiasm will transfer at the ballot box, particularly among conservative voters who regularly vote Republican and tend to support gun rights.

An overwhelming majority of voters from both parties support expanded background checks and so-called red flag laws, which allow authorities to remove guns from people determined to be a danger to themselves or others. Among Democratic voters, support for both measures is nearly universal, while 81% of Republicans support expanded background checks and 72% support red flag laws.

Republican lawmakers have blocked a slate of gun control measures, including expanded background checks and red flag laws, despite support from their constituents.

This summer, Democratic Gov. Ralph Northam called for a special session to address gun violence after the shooting in Virginia Beach in which 13 people were killed by a city employee who opened fire in a municipal building. Democrats readied a number of bills aimed at tightening gun laws. Republicans reacted dismissively, voting to adjourn after just 90 minutes and saying they would refer the bills to the state's crime commission and reconvene the session after the November election.

That decision reinvigorated the efforts of gun control advocates, says Steve Farnsworth, a professor of political science and international affairs at the University of Mary Washington in Fredericksburg, Virginia.

"Among gun control advocates, there's a significant pent-up demand for change that, in many ways, was exacerbated by the Republican legislative majority's decision not to even talk about gun control possibilities," Farnsworth says.

The Photos You Should See – Oct. 2019 View All 84 Images

Last week, Giffords, a gun violence prevention group started by former Democratic Rep. Gabby Giffords, who was shot during an assassination attempt in 2011, rolled out a $300,000 ad buy targeting Republicans for stonewalling gun reform measures.

"America is in crisis," a narrator says in one of the 30-second ads before the screen cuts to newscasts from mass shootings, including images of memorials at Virginia Beach.

"But when they had a chance to act on gun reform, Virginia Republicans ran away," the ad continues. "Every member of the Virginia legislature is up for reelection this November. Virginians support common-sense gun reform. We deserve legislators that do, too."

The ad and two others will run statewide and heavily target Richmond, Northern Virginia and Virginia Beach in an attempt to turn out Democratic voters for whom gun safety is a top issue, the Giffords organization said in a press release.

Suburbs in Northern Virginia, Richmond and Virginia Beach are also home to swing districts, some of which flipped from red to blue in 2017 elections.

Everytown for Gun Safety Action Fund, the political arm of one of the biggest gun violence prevention groups in the country, has been bankrolling ad campaigns in Virginia since August. The group has pledged $2.5 million toward the election, the most it has ever spent in the state and one of the biggest efforts it has ever undertaken focused specifically on a state legislature.

John Feinblatt, Everytown's president, says the statewide elections are a "curtain raiser" for 2020 and notes that gun policy was a key issue in the 2017 elections when voters put a Democratic governor and lieutenant governor in office and turned several districts blue. This year, however, voters are particularly energized by the Virginia Beach shooting and its political aftermath, Feinblatt says.

"In the area that we are investing, gun safety is making the case for candidates, and we're going to help our candidates make the case," Feinblatt says. "Speaking about gun safety is speaking directly to the voters of Virginia who realize that the General Assembly, even after the mass shooting in Virginia Beach, the General Assembly turned their backs on the voters."

Everytown tested messaging on a number of different issues in certain districts and found that messages about gun control – particularly red flag laws – proved the most effective among voters, a spokesman for the group said.

On the other side of the issue, the National Rifle Association, which is headquartered in Virginia, gave $200,000 to Republican candidates in September in the largest contribution ever made by the group in the state. The record-large NRA donation, however, pales in comparison to the millions pledged by gun control groups.

The fact that gun policy is so central to the election is a signifier of how much the state's politics and demographics have shifted over time, Farnsworth says.

Farnsworth attributed that change to several factors, including the influx of out-of-state young people and retirees to Virginia, as well as the national increase in mass shootings. The Virginia Beach shooting and the 2007 shooting at Virginia Tech, where 32 people were killed, have taken a toll on Virginians, Farnsworth says.

Virginia has also shifted from solidly red to left-leaning: Voters backed former President Barack Obama in 2008 and 2012 and supported presidential candidate Hillary Clinton in 2016. Before 2008, Virginia had not voted for a Democratic presidential candidate since Lyndon Johnson in the 1960s.

Democrats see gun control as an issue that could further the state's leftward tilt. But while the party has zeroed in on gun control and Republicans' inaction on gun reform, some GOP candidates are also trying to get ahead of the issue on the campaign trail.

Siobhan Dunnavant, a first-term Republican state senator from a competitive district in the Richmond suburbs, released a TV ad this month acknowledging the problem of gun violence.

"Gun violence is a crisis, but there are no easy answers in a free society," Dunnavant says in the ad, going on to propose a mental health hotline and reporting process for violent threats. "I supported a federal ban on bump stocks used in mass shootings. … As a doctor, I believe in prevention. As a mother, I believe in action."

Dunnavant, though, voted in 2018 to halt a state Senate bill to ban bump stocks – devices that enable a semiautomatic gun to fire continuously with one trigger pull. Later the same year, the devices were banned at the federal level . A bump stock was used by the gunman in a 2017 Las Vegas shooting that killed 58 people.

The senator's campaign did not immediately return a request for comment, but her campaign manager told The Richmond Times-Dispatch that the lawmaker believed at the time that anything short of a federal ban on bump stocks would be ineffective.

While most Republican candidates are unified against expanded background checks and red flag laws, one has broken rank to back the measures. Mary Margaret Kastelberg, who is running for an open House of Delegates seat in the Richmond suburbs, supports both initiatives. Her district is a battleground and flipped from red to blue in the 2017 state House elections.

Farnsworth says the statewide shift on gun politics has been sudden and dramatic – and that makes the influence on this year's elections far from predictable.