If Democrats hold onto their Senate majority this year, the North Carolina Senate race may be their life raft. Incumbent Sen. Kay Hagan (D) has managed to maintain a small lead over Republican Thom Tillis in all of the five most recent polls.

Hagan was considered one of the most vulnerable Democrats. She was first elected in 2008, when President Obama drove massive turnout and carried the state. Since then, Obama’s approval has plummeted. In 2012, conservatives — fueled by massive contributions from multimillionaire Art Pope — took over the governor’s mansion as well as both chambers of the legislature. One of their first acts was to push through restrictions on voting, including ending same-day voter registration and curtailing early voting, in an effort clearly designed to suppress the votes of poor and minority voters. (The Supreme Court just overruled the U.S. Court of Appeals for the 4th Circuit, which had stayed implementation of the measures under the Civil Rights Act.)

Almost two-thirds of U.S. voters surveyed think the country is on the wrong track. Mitt Romney won North Carolina in 2012 by a small margin. And the state hasn’t reelected a Democratic senator since Sam Ervin in 1968.

Not surprisingly, Hagan was targeted early by the deep-pocket right-wing PACs. Americans for Prosperity dumped a staggering $7 million in ads against Hagan by March of this year. Karl Rove’s fronts — American Crossroads and Crossroads GPS — plan to spend $1 million a week in the last month of the campaign. (Tillis, the speaker of the North Carolina House, was Rove’s candidate in the Republican primary.)

Tillis and the outside groups have followed the Republican script: Offer little in the way of a positive agenda, while tying Hagan to Obama and Obamacare.

Hagan has done what most Democratic senators running in red and purple states have done. She paints herself as “the most moderate senator,” touting her ability to work across the aisle. She has distanced herself from Obama. Despite that, her disapproval rating remains at more than 50 percent.

If Hagan survives, it will largely be because of the reaction against the harsh measures passed by Tillis and other Republicans in the state legislature. They slashed spending on education, pushed to defund Planned Parenthood, refused to expand Medicaid under Obamacare and passed the voter suppression measures.

That assault triggered a growing popular mobilization, spearheaded by what became Moral Mondays, led by Rev. William Barber, head of the state NAACP. Moral Mondays organized weekly protests against the state legislature, with sit-ins and civil disobedience backed by an expanding coalition of organization and activists. In February, a crowd the NAACP estimated at 80,000 gathered for a march in Raleigh to support the more than 150 groups involved in the state’s Forward Together Movement, including those working on issues concerning women, immigrants, the environment and lesbians, gays, bisexuals and transgender people. Now the state legislature that Tillis heads is even less popular than Hagan.

In addition, Moral Mondays has worked to register and inspire voters, particularly among the young, minority and poor voters targeted by the voting law changes. Barber makes it clear that Moral Mondays is moral, nonpartisan and not tied to any candidate. Hagan has been neither its champion nor an avid supporter. But Tillis was tagged early as a leader of a reactionary movement that had to be stopped. Hagan presents herself as above the fray, but she is propelled by a populist mobilization that will help get out the vote, despite the voting changes and despite the off-year malaise afflicting voters generally and Democratic voters particularly.

Moral Mondays’ defense of the poor, of voting rights and of investment in education has been reinforced by the anger of the state’s teachers against the deep cuts to education. The National Education Association has just dropped a new ad featuring a teacher explaining the ruinous effects of the cuts. Planned Parenthood is putting $3 million into the race in ads focused on contraception and equal pay for women. As a result, Hagan is buoyed by one of the largest gender gaps in any competitive Senate race.

With Hagan taking a small but consistent lead in the race, Republicans have started to panic. The National Republican Senatorial Committee brought new blood into the campaign and is pouring more money into it.

Republicans realized that Tillis was losing the “message war.” “If we continue to fight over education, we lose. But we’re starting to move off of that,” Dallas Woodhouse, head of Carolina Rising, a pro-Tillis conservative group, told the Hill.

Tillis has recently turned to peddling fear, pounding on Hagan for being weak on the terrorist threat posed by the Islamic State since she missed some Armed Services Committee hearings. The Hagan campaign paints this as desperation. “The Tillis campaign is desperately trying to change the subject because they realize how unpopular he is,” Hagan spokesman Chris Hayden told the Hill.

Hagan is far from a sure thing. The deluge of 24/7 negative ads surely will turn off some voters, driving down turnout. The national news hasn’t gotten any cheerier. But if Hagan survives, it won’t be because she’s the “most moderate senator.” It will be because of the populist mobilization against her most immoderate opponent.

Read more from Katrina vanden Heuvel’s archive or follow her on Twitter.