AS IT became clear Saturday that Joe Biden had garnered enough electoral votes to claim the presidency, even his supporters were not in an entirely celebratory mood. President Trump was doing his best to delegitimize Mr. Biden’s victory with groundless lawsuits and bogus allegations of election theft. After the potential recounts and court fights lay the prospect of Washington gridlock between a Democratic president and a Republican Senate.

Those are real worries. But before turning to them, let us pause and, yes, celebrate.

Though the election did not result in the ringing repudiation that Mr. Trump deserved, voters still rejected him, the first time in 28 years that a president has been turned out after a single term. Mr. Biden and his running mate, California Sen. Kamala D. Harris, built a broad coalition of traditional Democratic voters and independents disgusted with Mr. Trump. They won the highest number of votes of any presidential ticket in history and will end with an impressive margin of victory and and strong showings in states in every region of the country.

President-elect Joe Biden and Vice President-elect Kamala D. Harris called for unity after being the projected winners of the 2020 election on Nov. 7. (The Washington Post)

Instinctively optimistic, unwilling to write off any of his fellow Americans, not likely to be pushed around by hyper-partisans on either side, Mr. Biden is exceptionally qualified to heal a deeply divided nation. He won on a promise to unify the country and to address major problems that have been neglected or aggravated over the past four years. Voters should expect him to live up to his promises — and Senate Republicans, if they do retain their majority, should accept his open hand in a spirit of decency and cooperation. If the voters elected a divided government, they may have been asking for moderation, but they were not voting for stasis.

Mr. Biden’s victory — and Mr. Trump’s defeat — is a testament to the resilience of American democracy. In other countries, at other times, bullies like Mr. Trump have succeeded in becoming strongmen by promising security from dangerous outsiders, demonizing cultural elites and sowing enough confusion and apathy that people failed to resist the slide into illiberalism. Mr. Trump tried all of these tactics. But Americans resisted. They did so in an overwhelming yet orderly fashion, at the ballot box, when it was their turn to have another say, despite the fact that Mr. Trump and his allies adopted a strategy of disenfranchisement when they realized they could not win fairly. They answered his four years of divisiveness by electing a woman — a woman of color — to be vice-president for the first time in the nation’s history. Citizens in unprecedented numbers stood in line for hours to vote, starting weeks before Election Day. State officials adhered to their responsibilities to ensure that people could cast ballots. Withstanding Mr. Trump’s spiteful and mendacious attacks on their integrity, they ensured that those votes would be counted.

The first task of this new, potentially divided government must be to reinforce the institutions and norms that creaked under Mr. Trump’s assaults. After an election that showed Republicans can compete when larger numbers of voters turn out, they should be more willing than before to make voting easier.

Even with reform, voters will sometimes get it wrong. But our democracy survived crises that came before, and we may just have weathered another, hopefully gaining some hard-won wisdom in the process. Amoral opportunists come and go. The nation’s founding principles live on another day, thanks to a generation of voters who did their part to preserve the Republic.

Read more: