WASHINGTON (AP) — This week’s ballot had an unspoken candidate — American democracy. Two years of relentless attacks on democratic traditions by former President Donald Trump and his allies left the country’s future in doubt, and voters responded.

Many of the candidates who supported the lie that Trump won the 2020 election lost races that could have put them in position to influence future elections. But the conditions that threatened democracy’s demise remain, and Americans view them from very different perspectives, depending on their politics.

In New Hampshire, voters reelected Republican Gov. Chris Sununu to a fourth term but rejected three congressional candidates who were either endorsed by Trump or aligned themselves with the former president. Instead, voters sent Democratic incumbents back to Washington.

Bill Greiner, a restaurant owner and community bank founder, said the Trump candidates won their Republican primaries by “owning the crazy lane” and then provided an easy playbook for Democrats in the general election.

Greiner, a Republican, said in past years he has fallen in line behind GOP nominees when his preferred candidates lost primaries, but he couldn’t vote for candidates who continued to deny the legitimacy of the 2020 presidential election.

“The election was not stolen, and anyone who leads with and finishes with being an election denier is not going to do well,” he said. “I think that point was proven with exclamation marks.”

In the run-up to the midterm election, President Joe Biden put the spotlight on threats to American democracy, although critics suggested it was a ploy to take attention off his poor approval ratings and voter concerns about the economy.

On Thursday, Biden said the nation’s core principles had endured: “There were a lot of concerns about whether democracy would meet the test. And it did!”

Election Day showed Biden was not alone in his anxiety: 44% of voters said the future of democracy was their primary consideration, according to AP VoteCast, an extensive survey of more than 94,000 voters nationwide. That included about 56% of Democrats and 34% of Republicans.

But among Republicans, those who identify as being part of Donald Trump’s Make America Great Again movement were more likely than others to say the future of democracy was the top factor when voting, 37% to 28%.

The concerns over democracy were shared by members of both major parties, but for different reasons: Only about a third of Republicans believe Biden was legitimately elected, according to the AP VoteCast survey, showing how widely Trump’s continued false claims about the election have permeated his party.

Democrats, meanwhile, believed the spread of election lies and the number of Republican candidates repeating them were an assault on the foundation of democracy.

Several of the most vocal candidates who denied the results of the 2020 presidential election ended up losing races for statewide office that play some role in overseeing elections.

Trump and his supporters targeted races for Secretary of State, the office that oversees voting in most states, after being unable to overturn 2020 election results at the state level.

The AP VoteCast survey also showed the effect the false claims have had on how Americans view the security of elections. It found that MAGA Republicans were more likely to lack confidence in the midterm vote — about half of MAGA Republicans overall were not confident the vote would be counted accurately, but just 3 in 10 of their non-MAGA counterparts had those concerns.

There was no widespread fraud in the 2020 election or any credible evidence that it was tainted, as confirmed by federal and state election officials, exhaustive reviews in battleground states and Trump’s own attorney general.

The former president’s allegations of fraud were also roundly rejected by dozens of courts, including by judges he appointed.

Still, the conspiracy theories run deep. They offered fertile ground for sowing mistrust when fairly routine problems arose Tuesday in Detroit and Maricopa County, Arizona. The trouble was easily solved, but not before it sparked recriminations on social media, including posts by Trump.

Arizona’s Republican gubernatorial candidate, Kari Lake, raised the possibility of nefarious activity and has said if she wins, she would call a special session to make massive changes to Arizona election laws.

Questions about elections were directly on the ballot in several states.

In Nebraska, voters approved a voter ID proposal that was born in the aftermath of the 2020 election and the false claims of fraud. Michigan voters approved a wide-ranging initiative backed by voting-rights advocates. Among other things, it would expand early voting options, require state-funded return postage and offer drop boxes for absentee ballots. The measure also specified that the Board of State Canvassers has only a “clerical, nondiscretionary” duty to certify election results.

Long-term victory should not be declared, said Ron Daniels, president of the Institute of the Black World 21st Century: “The white nationalist, white supremacist, MAGA movement has been checked but not defeated.”

He said Black voters, especially, were aware of what was at stake. The election deniers who would potentially nullify votes were part of a long history of efforts to deny people, especially people of color, representation.

The results were “dangerously close,” Daniels said. “We have to wait to see the ultimate outcome.”

Michigan Secretary of State Jocelyn Benson, a Democrat who won reelection against a candidate who has repeated Trump’s 2020 falsehoods, said she was heartened to see concessions from candidates who had previously refused to acknowledge that Biden’s win was legitimate or who repeated Trump’s election lies.

Among them was Minnesota Republican gubernatorial candidate Scott Jensen, who lost to the incumbent Democratic governor.

“Tim Walz is the governor for four more years,” he told supporters. “Republicans, quite frankly, we didn’t have a red wave. It was a blue wave. And we need to stop, we need to recalibrate. We need to ask ourselves: ‘OK, what can we learn from this? What can we do better?’”

Jenna Ellis, senior legal adviser for Pennsylvania Republican gubernatorial candidate Doug Mastriano, said on her podcast: “There isn’t this kind of concern that we had in 2020. We can’t just say, ‘Oh my gosh, everything is stolen.’ That’s ridiculous for this election.”

The fact that some of the strongest supporters of Trump’s claims conceded could help “reestablish some of the norms of the democratic process that were trashed during Trump,” Dartmouth historian Matthew Delmont said.

The question now is whether democracy is safe, or just safe today, he said.

___

Associated Press writers Holly Ramer in Concord, New Hampshire, and Chris Megerian and Aamer Madhani in Washington contributed to this report.

___

Follow AP’s coverage of the elections at: https://apnews.com/hub/2022-midterm-elections. And check out https://apnews.com/hub/explaining-the-elections to learn more about the issues and factors at play in the 2022 midterm elections.