In the months since Joe Biden won the 2020 presidential election, we’ve watched a barrage of efforts to reverse the result — President Trump launched rants, recounts, lawsuits, threats and now a violent insurrection at the Capitol aimed at disrupting congressional certification of the results. The denial and the chaos have been shocking. But are they unprecedented?

Not exactly. The very first contested presidential election, in 1800, was also chaotic. It, too, reflected ferocious partisanship, exposed problems in the electoral process and ended in a raucous congressional session in which the losers tried to flip the results. When it was all over, however, the winners reached for bipartisanship. They fixed the broken process by bequeathing us the 12th Amendment, which still guides presidential elections — right down to the step that turned unexpectedly explosive in 2021: “The President of the Senate shall, in the presence of the Senate and House of Representatives, open all the certificates [transmitted by the states] and the votes shall then be counted.” But for all they did right, those early American leaders failed to confront the nation’s deepest problem — slavery.

In many ways, that election — between Federalist President John Adams and Republican Vice President Thomas Jefferson — resembled 2020. Seven (out of 16) states fiddled with the voting rules to boost their candidate — Pennsylvania was so bitterly divided about its voting procedures that it almost missed the election. Each party thought the other dangerous — the two sides believed they were fighting about nothing less than the nation’s identity. The Federalists, based in New England, fretted about too much democracy, too many immigrants and seditious speech that could undermine the people’s faith in their government. Republicans, based in the South, shot back that their rivals were nothing less than monarchists — stifling free speech, repressing the people and endangering slavery by recognizing the Haitian rebels who had thrown off their bondage.

In the end, Jefferson easily won the popular vote and squeaked by in the electoral college. Then, the shenanigans began thanks to the rules governing the electoral college. The Constitution clearly stated the person with the most votes would be president, the runner-up vice president. But in 1800, the political parties — which the men who wrote the Constitution did not see coming and roundly abhorred — nominated tickets. Both Jefferson and his running mate, Aaron Burr, tallied the same number of votes. The election headed to the House of Representatives which might have simply certified Jefferson as president and Burr as VP. But the defeated Federalists tried to steal a victory by flipping the ticket, rallying around Burr and trying to boost him into the presidency. After all, they reasoned, Burr was an expedient politician who would defect to the party that thrust him into power.

In the House of Representatives each state would cast a single vote — a majority (nine states) would secure the presidency. The House voted. And voted. And voted again. Each time, the sitting vice president — none other than Jefferson himself — tallied the same result: Eight states for Jefferson. Six for Burr. Two abstained (because their delegations were evenly divided between the parties). Jefferson, one agonizing state short of victory, saw “dismay and gloom.” Six different state delegations were divided by a single vote and the Federalists could reach a majority by flipping just three strategically placed Republicans.

To make matters worse, the government had moved in 1800 from the large, cosmopolitan city of Philadelphia to the grim village of Washington, D.C., which amounted to little more than a few rude taverns and boardinghouses. Tree stumps marked the muddy path between the executive building and the half-constructed capitol building. “We want nothing here,” wrote New York’s Gouverneur Morris sarcastically, “but houses, cellars, kitchens, well-informed men, amiable women, and other little trifles of this kind to make our city perfect.” There was nothing to do but drink, gamble and conspire.

Through the process, Alexander Hamilton, the most influential Federalist, broke with his party and scribbled one letter after another denouncing Aaron Burr. The two men knew each other well, for they had battled in New York for years. Now Hamilton warned that Burr had no principles at all — just a simple lust for power. He would be a despot.

Finally on the 36th ballot, Federalist James Bayard of Maryland, after three letters from Hamilton, cast a blank ballot which broke the state’s four-four tie and flipped it into Jefferson’s column. Other Federalists followed his lead and Jefferson finally took the office he had won at the polls.

All that rigmarole from long ago broadcasts important lessons to our own time.

After 1800, leaders quickly adjusted the Constitution by adding the 12th Amendment. Electors would now cast separate ballots for president and vice president to prevent a tie — and then transmit the results to Washington. Procedural fixes helped prevent the problems that had beset the 1800 election.

But, there was a deeper issue they didn’t resolve — slavery. The Federalists seized on it as a way to attack the new administration. They groused that Jefferson had won the election only because the Constitution inflated the power of his Southern base through the notorious three-fifths clause that helped allocate electoral votes. Jefferson “rode into the temple of liberty upon the shoulders of slaves,” as one Connecticut newspaper put it.

The volcanic issue was only beginning to rumble. Some Federalists denounced slavery, others took the opposite tack and warned that the Republicans imperiled the institution with all their talk about the rights of man. The losers were more focused on resisting Jefferson’s political power then in engaging the issue itself. The deepest national problem festered and grew till, less than two decades later, an aging Jefferson thought he heard the passions over slavery tolling the “knell of the union.”

Today, a deep partisan division once again spurred an effort to overthrow the presidential election. Like that long ago contested election in 1800, we, too, risk letting our political differences obscure deep national problems: More than two centuries later, the race line remains raw and marked by injustice. We face an economic inequality that has soared to levels unmatched among wealthy democracies. We confront a ferocious urban/rural rift and a burning planet. A deeply divided Washington — reflecting a deeply divided nation — has a lot of work to do. The final lesson from 1800: We ignore the big problems at our peril.