Aiding the governor are the simple facts of demographics. Ayotte won in 2010 as part of the Tea Party revolution. But as in much of the nation, presidential cycles tend to be more favorable than midterms for Democrats in New Hampshire. “She’s dealing with a different electorate,” notes the political analyst Dean Spiliotes, a civic scholar at Southern New Hampshire University.

At the same time, Ayotte has lost some of her sparkle among conservatives. “There are constituencies in the Republican party that she needs who no longer really trust her as a conservative,” said Spiliotes. “Over the course of the last couple of years she has gone out of way at times to talk about bipartisanship and show herself to be a little more progressive on issues like women’s reproductive health,” he explained. “It’s not like she has abandoned ship, but there has been just enough triangulation to makes some conservatives uncomfortable.”

Now, into this high-stakes high-wire act, drops one of the highest-octane issues in American politics: guns. And before you can say “the right of the people to keep and bear arms,” the electoral landscape has grown even more fraught for Ayotte.

Gun-control advocates have been miffed at the senator since 2013, when, in the wake of the Sandy Hook massacre, she opposed the Manchin-Toomey bill to expand background checks for gun buyers. (She backed a far weaker alternative, approved by the NRA.) “Senator Ayotte was one of the senators that most disappointed people with her ‘no’ vote,” said Pia Carusone, a senior advisor for Americans for Responsible Solutions, the gun-control group founded by gunshot-survivor former Representative Gabby Giffords. Gun-control groups took out after Ayotte, dispatching activists to dog her at events across the state. (At one memorable town-hall meeting, the daughter of the slain Sandy Hook principal confronted the senator about her votes.)

Firearms make for complicated politics in New Hampshire. The state has libertarian leanings and a thriving gun culture. (Last year, Guns & Ammo named it the 10th best state for gun owners.) Even so, north of 80 percent of Granite Staters favor expanded background checks—a number with which gun-control advocates delight in hammering Ayotte.

Of course, three years is an eternity in politics. And in recent months, the hot debates in New Hampshire were more about Supreme Court vacancies and the opioid epidemic. Until the June 12 massacre at an Orlando nightclub, when guns came roaring back as both a national and state issue.

While Democrats held a sit-in and agitated for gun bills on Capitol Hill, gun-control activists renewed their assault on Ayotte. Everytown for Gun Safety (Michael Bloomberg’s group) and its grassroots arm, Moms Demand Action, ran digital and print ads attacking her. Americans for Responsible Solutions hit her with TV ads. Organizers once more began phoning and showing up at her office and at events. At both the June 25 Portsmouth Pride Parade and the 4th of July parade in Merrimack, activists handed out flyers criticizing her record.