In the 1860s, a president’s unilateral firing of a cabinet member could become an automatically impeachable offense, thanks to a law intended to restrict presidential powers. In fact, it was a law that almost got a sitting president—Andrew Johnson—booted out of office.

The Tenure of Office Act seemed simple—it prevented the president from firing cabinet appointments that Congress had previously approved. But when President Andrew Johnson defied it, a standoff resulted. As a result of his combative attempt to skirt the law, Johnson was nearly impeached and has gone down in history as one of America’s worst presidents for his defiance.

Before the law was passed, presidents could fire cabinet members at will. But the law—created to stop Johnson’s attempts to soften Reconstruction for Southern states after the Civil War—wasn’t just any Congressional act. It resulted in an increasingly absurd spiral of one-upmanship that culminated in a rare presidential veto, an even rarer congressional override, a sensational impeachment trial that was so well-attended that Congress had to raffle off tickets, and an ongoing conflict over executive power.

It all started when Johnson, a Southerner who decided to support the North during the Civil War, was picked to run alongside Abraham Lincoln in 1864. The nation was in the midst of a roiling war, and Lincoln’s presidency was shaky as casualties racked up and opposition to his policies mounted. Lincoln needed to reach across the aisle, so he chose Johnson, a populist from Tennessee.

A political cartoon showing Vice President Andrew Johnson sitting atop a globe, attempting to stitch together the map of the United States with needle and thread. (Credit: Universal History Archive/UIG via Getty images)
A political cartoon showing Vice President Andrew Johnson sitting atop a globe, attempting to stitch together the map of the United States with needle and thread. (Credit: Universal History Archive/UIG via Getty images)

The strange vice-presidential pick worked, and Johnson got down to work as the vice president in 1865. But then disaster struck when Lincoln was assassinated. Johnson assumed the presidency, but it turned out his ideas about how to deal with the former Confederacy were quite different from his majority-Republican Congress.

Johnson didn’t want to punish former Confederate leaders, and he didn’t want to advance the cause of former slaves. He enacted a relatively lenient Reconstruction policy that allowed states to draw up their own constitution, then petition to be readmitted into the Union. He offered what Radical Republicans saw as a treasonous olive branch to former Confederates: a blanket pardon to most former rebels, and a chance for Confederate leaders to petition him for pardons.

Soon, Johnson had pardoned nearly every Confederate leader. Furious, an increasingly radical Congress worked to stop him. They began to work around his Reconstruction policy by introducing the 14th and 15th Amendments, which countered white Southerners’ bid to reestablish white supremacy in the South. Since the war’s end, violence against African-Americans had raged, and Southern states began passing new “black codes” that restricted African-Americans’ freedoms. The amendments were a way to put a stop to that wave of racism—and a workaround that bypassed the president’s own lenient policies.

Johnson was outraged. He saw the amendments as affronts to states’ rights and encouraged Southern states not to ratify them. “This is a country for white men, and by God, as long as I am President, it shall be a government for white men,” he wrote to Missouri’s governor.

As Johnson became more and more defiant, Congress became more and more determined to curb his power in a bid to save Reconstruction. They made their move by passing Reconstruction laws that were more sweeping than Johnson’s plan—then secured their ability to enforce them by passing the Tenure of Office Act. The law, which required the president to seek their approval before firing any executive officer they’d helped approve, would keep Johnson from sacking his Secretary of War, who was tasked with carrying out most of the Congressional Reconstruction plan.

Or so they thought. True to form, Johnson vetoed the bill. Congress then overrode the veto and the Tenure of Office Act went into law on March 3, 1867.

But Johnson wouldn’t be checked so easily. He gave his Secretary of War, Republican Reconstruction supporter Edwin Stanton, the boot by suspending him from his office while Congress was on recess. In a letter, Stanton responded angrily that “I am compelled to deny your right under the Constitution and laws of the United States…to suspend me from office.” But he had no alternative, he wrote, and stepped aside for Ulysses S. Grant, whom Johnson had appointed as interim Secretary of War.

When the Senate returned, they reinstated Stanton. Now, Grant stepped aside. Stanton was Secretary of War once more, so Johnson responded by firing him. In an even more spiteful move, he named Lorenzo Thomas, a general Stanton had disliked so much during the Civil War that he had threatened to “pick [him] up with a pair of tongs and drop him from the nearest window,” as Secretary of War instead. Furious, Stanton arrested Thomas for violating the law.

“It had become a comic opera,” writes historian Michael A. Eggleston, and the next act was a Congressional attempt to impeach Johnson for violating the act. In March 1868, the House of Representatives approved nine articles of impeachment and brought them to the Senate. Johnson’s trial became a public spectacle, and so many came to the Senate Chamber to watch it that the Senate began to hold a lottery for gallery passes. A thousand tickets were printed each day for the general public, and Senators had to turn away hundreds of constituents who begged them for a front-row seat on the dramatic trial. Today, the raffle system still exists—a little-known remnant of the impeachment spectacle.

The 1868 impeachment trial of Andrew Johnson
Bettmann Archive/Getty Images
The 1868 impeachment trial of Andrew Johnson. (Credit: Bettmann Archive/Getty Images)

Meanwhile, the president worked behind the scenes to appease Congress, appointing a Secretary of War, John M. Schofield, whom the Republicans liked better and promising to uphold Congressional Reconstruction. Ultimately, Johnson was impeached in the House of Representatives by 126 votes to 47, but narrowly avoided a two-thirds guilty verdict in the Senate by a single vote. After his acquittal, he served out the rest of his term.

But the Tenure of Office Act lived on. It was only revoked in 1887 after another standoff. When President Grover Cleveland summarily removed over 600 appointees with no explanation, Congress claimed he had violated the act and demanded that Cleveland’s cabinet provide documentation for the firings. Cleveland told his cabinet not to comply, and argued that the act didn’t apply. He even challenged Congress to impeach him if they didn’t like his appointments.

Eventually, Congress backed down and repealed the act. But it wasn’t quite dead yet. In 1920, when President Woodrow Wilson removed Frank S. Myers, a postmaster, from his position, without Congressional consent, Myers took him to court. He claimed that Wilson had violated an 1876 act of Congress that required presidents to get permission from Congress before removing postmasters.

The Supreme Court disagreed, and in their opinion on Myers v. United States, made it clear that a president has the power to appoint and remove executive officials. Johnson’s standoff had sparked a years-long debate about executive power—one that still rages today.

HISTORY Vault: U.S. Presidents

Stream U.S. Presidents documentaries and your favorite HISTORY series, commercial-free