For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

On May 31, a disgruntled city employee entered a municipal building in Virginia Beach and opened fire, killing 12 people. Virginians were horrified, then outraged. Ever since the mass shooting that killed 32 people at Virginia Tech in 2007, there’d been a growing push to strengthen the state’s comparatively loose gun laws. But Virginia Beach was a tipping point: Democratic Gov. Ralph Northam convened a special legislative session in July with the sole purpose of passing gun control laws.

Yet Virginia is also home to the National Rifle Association. On the day legislators gathered in Richmond, NRA officials turned the Republican House speaker’s conference room into a de facto war room, distributing hundreds of hats and T-shirts to the gun rights supporters who showed up at the Capitol. Some were packing heat; several donned full tactical gear and toted assault rifles as they milled about under the summer sun. The display was an attempt to “intimidate and silence” the hundreds of gun control activists rallying nearby, said Shannon Watts, founder of the gun control group Moms Demand Action. Inside, the Republican-controlled legislature adjourned after just 90 minutes without considering a single bill.

“That was the curtain raiser for this election,” said John Feinblatt, president of Everytown for Gun Safety, the organization—heavily funded by former New York Mayor Michael Bloomberg—that Moms Demand Action is part of.

Nearly four months later, Virginia’s Republican majority in the Senate and House was swept out in an off-year election. Now, for the first time in more than 25 years, Democrats have full control of the state government. Several pieces of progressive legislation that Republicans had blocked—workplace and housing protections for LGBTQ residents, a minimum wage hike, the Equal Rights Amendment—could soon pass. But for gun control activists, this blue wave signifies something bigger: Republicans’ allegiance to the gun lobby is eroding their appeal with suburban voters they can’t afford to lose.

After the Virginia Beach shooting, gun groups went all in on Virginia. Everytown and Moms Demand Action say they spent at least $2.5 million to elect Democrats. Giffords, the group co-founded by former Arizona Rep. Gabby Giffords, spent $300,000 on ads. Meanwhile, the NRA—currently hobbled by political scandals and depleted finances—barely contributed $350,000 to GOP candidates. And it didn’t take defeat well. The day after the election, the NRA tweeted a photo of Bloomberg with Harvey Weinstein and a message to Watts: “Your freedom-hating group has one thing only: Bloomberg’s billions…This election was not because of you or your organization. It was because of ONE billionaire’s wallet.”

Many people were watching this election as a bellwether for 2020. “What you saw in Virginia was really a trend that had been visible in 2017 and 2018,” said Stephen Farnsworth, a political science professor at the University of Mary Washington in Fredericksburg. “President Trump is really unpopular in the suburbs, and that motivates a lot of Democrats to turn out.” But beyond Trump’s unpopularity, the shift on guns has helped flip the state’s once solidly red suburbs. Polls found that gun violence was the number one issue for Virginia voters, who showed bipartisan support for passing universal background checks and removing guns from people deemed to present a safety risk. “It used to be that Democrats wouldn’t talk about gun control outside of the most blue urban districts,” Farnsworth said, but no longer.

Case in point: the 40th District—right next door to NRA headquarters—whose longtime state Rep. Tim Hugo was the last Republican lawmaker in the Northern Virginia suburbs. Everytown and Giffords identified the district as flippable and supported Dan Helmer, an Army veteran who made gun reform the center of his campaign. Helmer told me that even before Virginia Beach, the issue of gun control was “overwhelmingly” the top concern among voters he talked with. “More Virginians die of gun violence each year than die in car accidents, which, if you think of the number of firearms and then the number of cars, is mad,” he said. He won by over six points.

Looking ahead to November, gun control groups are optimistic that they can repeat their success nationally. Peter Ambler, Giffords’ executive director, thinks the outcome in Virginia proves that the once–deep red swaths of suburbia are turning blue. Gun safety has become a potent opportunity for Democrats in those areas, and gun control activists’ relentless campaigning is paying off. “I’m not going to tell you Democrats will end up with control of Texas in the next year and a half,” Ambler said, “but what you will see in states like Texas…is the same type of shift that you’ve seen in Virginia for the past few years.”