President Trump’s attacks on the federal appellate judges considering a constitutional challenge to his immigration ban—he called the proceedings “disgraceful” and the courts “so political”—has provoked widespread condemnation from across the political spectrum. Even Judge Neil Gorsuch, Trump’s Supreme Court nominee, said the criticisms were “demoralizing” and “disheartening.”

Some might look for a historical precedent for Trump’s attacks in the alleged comments of Trump’s hero Andrew Jackson, who criticized Chief Justice John Marshall’s decision in a case involving the Cherokee Indians. “John Marshall has made his decision, now let him enforce it,” the former president allegedly said. In fact, Jackson, whose portrait hangs in Trump’s office, provides no historical support for Trump’s unprecedented personal assault on the motives of judges evaluating the constitutionality of his executive orders. Jackson criticized Marshall on constitutional, rather than political, terms, and he ultimately required Congress and the states to acknowledge the Supreme Court’s authority to interpret the Constitution, rather than threaten to disregard it.

Jackson’s constitutional clashes with Marshall were precipitated by the most important constitutional clash of the early republic, involving the Bank of the United States. At Alexander Hamilton’s urging, Congress established the First National Bank of the United States in 1791 and the Second National Bank in 1816. States, who feared competition with their own banks, insisted that the National Bank violated principles of federalism and exceeded Congress’s power to regulate interstate commerce.

In McCulloch v. Maryland in 1819, Marshall interpreted Congress’s powers in the Hamiltonian spirit, rejecting Jefferson’s views that the states were sovereign governments who could tax the bank and substitute their own constitutional views for those of Congress. Instead of attacking Marshall directly, Jefferson wrote a private letter the following year complaining that “the judiciary of the United States is the subtle corps of sappers and miners constantly working under ground to undermine the foundations of our confederated fabric.” He also endorsed attacks on McCulloch by radical partisans of states’ rights, insisting that the Supreme Court had no authority to review the constitutionality of state laws. Later, Jefferson seemed to deny the power of the Supreme Court to bind the other branches with its interpretations of the Constitution. But although Jefferson detested his distant cousin and archrival Marshall, and criticized him vividly in private as a sophist, he did not attack his motives in public or defy his decisions.

The constitutionality of the bank of the United States provoked an even more explosive conflict between Marshall and Jefferson’s populist successor, Andrew Jackson. After he became president, Jackson resurrected Jefferson’s interpretation of limited federal power in vetoing a request to renew the bank’s charter in 1832, the first veto in American history on constitutional grounds. In his veto message, Jackson described his disagreement with the McCulloch decision and insisted that the Court wasn’t necessarily the final arbiter of the Constitution because the president and Congress could reach their own interpretations. “It is as much the duty of the House of Representatives, of the Senate, and of the president to decide upon the constitutionality of any bill or resolution which may be presented to them for passage or approval as it is of the supreme judges when it may be brought before them for judicial decision,” Jackson wrote. “The opinion of the judges has no more authority over Congress than the opinion of Congress has over the judges, and on that point the president is independent of both. The authority of the Supreme Court must not, therefore, be permitted to control the Congress or the Executive when acting in their legislative capacities, but to have only such influence as the force of their reasoning may deserve.”

Jackson then transferred one treasury secretary and fired another in order to remove federal deposits from the bank in the face of congressional disapproval. Jackson’s actions were legally questionable, although not clearly illegal, and the Senate censured him in 1834 because it lacked sufficient support for impeachment. Three years later, Democrats regained the majority in the Senate and removed the notation of censure. But the same year, a spending spree by the state banks, which were bloated by federal deposits, caused a financial crash that eventually drove the Democrats from power.

What’s notable about Jackson’s fight with Marshall over the bank is that it was fought entirely on constitutional, rather than personal, terms. Jackson didn’t question Marshall’s motives or call him a politician in robes. This reflected the fact that Jackson, unlike Trump, was a trained lawyer and former judge with a clear constitutional vision, having served on the Tennessee Supreme Court from 1798 to 1804.

The same sensitivity to constitutional roles suffused Jackson’s most famous conflict with Marshall. In the Cherokee Indians case, Worcester v. Georgia in 1832, Jackson was livid at Marshall’s ruling that Georgia state laws seizing Cherokee lands violated federal treaties and laws. Georgia had jailed two missionaries for refusing to obey these anti-Cherokee laws and had sentenced them to hard labor. In a 5 to 1 decision, Marshall held that Georgia laws used to seize Cherokee lands violated federal law and treaties. “The Cherokee nation, then, is a distinct community occupying its own territory in which the laws of Georgia can have no force,” he wrote. “The whole intercourse between the United States and this nation, is, by our constitution and laws, vested in the government of the United States.” After Marshall handed down the decision, Justice Joseph Story said: “The Court has done its duty. Let the nation now do theirs.”

Jackson, who had built his career on expanding American territory into Native American lands, privately sided with Georgia but publicly remained silent. As historian Jon Meacham notes in his biography of Jackson, American Lion, the president’s foe and election rival Henry Clay was unsettled by Jackson’s silence. Writing in March 1832, he said: “The consequences of the recent decision of the Supreme Court must be very great. If it be resisted, and the president refuses to enforce it, there is virtual dissolution of the union. For it will be in vain to consider it as existing if a single state can put aside the laws and treaties of the U.S. and when their authority is vindicated by a decision of the S. Court, the president will not perform his duty to enforce it.”

Jackson is famous for having privately remarked, according to the celebrated editor Horace Greely, that “John Marshall has made his decision, now let him enforce it.” But his actual remark, to his ally John Coffee, seems to have been: “The decision of the Supreme Court has fell still born ... and they find that it cannot coerce Georgia to yield to its mandate.” Unlike Jackson, Georgia tried openly to defy Marshall, passing a law declaring that anyone who came to Georgia to enforce the Supreme Court ruling would be hanged. Jackson, who had no desire to threaten Georgia with federal forces or openly challenge the Supreme Court, solved the problem deftly by convincing the governor of Georgia to set the missionaries free. The Supreme Court never had to issue an order requiring compliance and the crisis was defused. As a relieved Chief Justice Marshall wrote to Justice Story: “Imitating the Quaker who said the dog he wished to destroy was mad, they said Andrew Jackson had become a federalist, even an ultra-federalist. To have said he was ready to break down and trample on every other department of the government would not have injured him, but to say that he was a federalist—a convert to the opinions of Washington, was a mortal blow under which he is yet staggering.”

The Georgia crisis provoked Jackson openly to embrace federal authority in a way he had previously resisted. Georgia’s intransigence spurred other states to try to nullify federal laws, leaving Jackson with no choice but to ask Congress to authorize the executive to use the military to enforce the Supreme Court’s rulings. In 1832, South Carolina asserted its power to nullify federal laws it rejected. Jackson defended the Court, issuing a proclamation emphasizing that its decisions had to be obeyed. And when Marshall died three years later, Jackson hailed his former adversary as a national hero:

I sometimes dissented from the constitutional expositions of John Marshall, I have always set a high value upon the good he has done for his country. The judicial opinions of John Marshall were expressed with the energy [and clarity,] which were peculiar to his strong mind, and give him a rank among the greatest men of his age.

In other words, nothing in Jackson’s constitutional legacy compares with President Trump’s attempts to malign the motives of individual judges or to suggest they are merely politicians in robes. On the contrary, Jackson challenged the Supreme Court on constitutional, rather than political, grounds, insisting on his own power to interpret the Constitution in ways that differed from Chief Justice Marshall, but ultimately avoiding a direct conflict with the Supreme Court and requiring Congress and the states to accept the authority of federal judges to expound the Constitution. For this reason, Jackson—like other presidents who clashed with the Supreme Court, including Abraham Lincoln, Franklin Roosevelt, and Harry Truman—preserved and acknowledged the independence of the judiciary and encouraged citizens to respect it.