Donald Trump has a problem.

He wants to retake power in 2024 by delegitimizing the electoral results from 2020. But that requires some shred of evidence, some fragment of fact — and he can’t find any. Even Cyber Ninjas, a company hired by Republicans in Arizona to scour that state’s results, has confirmed that Joe Biden won fair and square.

In lieu of presenting evidence of voter fraud, Trump may return to the Andrew Jackson comparisons that served him well years ago. This time, Trump might focus not on Old Hickory’s controversial time in office (1829-37) but rather on the equally controversial election of 1824, which Jackson’s fans called a “Corrupt Bargain.”

But here’s the thing: Jackson drew a different and more democratic lesson from his defeat that year than Trump has taken from last year’s results.

After a severe economic crisis in 1819-21, the dominant Democratic-Republicans split into semi-regional factions, producing several contenders for the White House in 1824: William Crawford of Georgia, Henry Clay of Kentucky and John Quincy Adams of Massachusetts. Jackson, a general and the hero of the War of 1812, entered the race as a political outsider, even though he had twice served in Congress.

Jackson’s wartime victories had opened millions of acres of Creek land for slaveholding cotton planters while also humbling the hated British, whose real and imagined atrocities in the 1770s and 1810s had left especially bitter memories in Appalachia. Not surprisingly, he dominated the 1824 vote in the Deep South and in Pennsylvania, winning 99 electoral votes. Crawford and Clay together secured 78 electors, while Adams — the only candidate who was not a slaveholder — swept the Northeast and took 84.

Because no one had a majority of the electors, Congress settled on Adams as the winner, and when the New Englander appointed Clay as secretary of state, Jackson’s fans cried foul. We can understand their anger, especially since it appeared that Jackson had won the popular vote — initial counts, repeated to this day on popular websites, gave about 150,000 votes for Jackson vs. 110,000 for Adams, with Crawford and Clay splitting 90,000.

Quick and dirty accounts of the Corrupt Bargain of 1824, in which two career politicians (Adams and Clay) cheated the people’s choice (Jackson), are easy to find. It’s equally easy to imagine Trump turning the story to his advantage, essentially using a historical analogy to “prove” that he was cheated like Old Hickory.

Not so fast.

Article II, Section I of the U.S. Constitution stipulates that when no candidate wins more than 50 percent of the electors, the House of Representatives will “chuse the President” [sic], with each state delegation having one vote. This reflected the founders’ conception of the United States, not just as a single population of Americans but also as a union of semi-sovereign states, each of which should have an equal voice in parts of the federal government.

So, the members of Congress did exactly what they were supposed to do on Feb. 9, 1825. They voted as states: 13 for Adams, seven for Jackson and four for Crawford.

Nor is it clear whether Jackson actually won the popular vote, in part because the ballots did not always identify the presidential candidate whom each elector would support. The political parties of the day were local organizations built around shifting agreements among leading men, often with only vague ties to national-level figures.

Moreover, six of the 24 states — including the most populous, New York — did not report any popular tally, because their legislatures still appointed their electors. A recent analysis found that Adams would have swept the Empire State, overcoming Jackson’s big advantages in the South and resulting in a total popular vote of 213,000 for Adams vs. 178,000 for Jackson (and an additional 239,000 combined for Crawford and Clay).

In short, the election of 1824 was controversial but constitutional. It certainly followed the rules laid out by the Founding Fathers and probably reflected popular opinion, at least among the White men who monopolized the franchise.

To be sure, Jackson seethed at the Corrupt Bargain, especially since he hated Clay as much as he hated any other person, no small thing. (He actually liked Adams for having supported his illicit war on Black, Creek and Seminole fighters in Spanish Florida in 1818.) Nonetheless, Old Hickory contained his legendary temper and accepted the outcome.

The general retreated to Tennessee while his supporters built a new political party: the Jacksonian Democrats, a loud and proud alliance of slavers and sailors, farmers and workers who believed that the people were sovereign, that government was corrupt, and that the United States had suffered too long at the hands of European empires and North American “savages.”

They rolled to victory four year later, even carrying New York in the election of 1828. Jackson, now president, then turned to his longtime priority: the removal of all Native peoples from the South to make room for White planters and enslaved Blacks. (He quietly made nice with the British, who bought most of the cotton.) His “war” with the Bank of the United States, which deepened his sense of connection to ordinary Americans, did not heat up until 1832, shortly before a second, less decisive victory gave him a second term.

Old Hickory was a violent exemplar of Whites-only democracy, but he had a deep, if troubled, sense of duty not only to his partisans but also to the United States more generally. And he accepted one of the cardinal rules of representative government: If you don’t win, you try again with a bigger, broader coalition. Or you go home.

That may not be the lesson that Trump wants to take from 1824, but it’s one that we should all remember as the clouds gather two centuries later.