The 17th president defied Congress, personally insulted rivals, and accused them of staging a coup. Here's everything you need to know:

Why was Johnson impeached?
His Republican adversaries in Congress accused him of defying the law, acting like a king, and speaking and acting in a way that was unbecoming of the presidency. America's 17th president took office upon the assassination of Abraham Lincoln, amid a polarizing struggle in Washington over the Reconstruction of the South after the Civil War. Johnson was an outspoken, temperamental populist given to fiery speeches laden with insults, blatant racism, and suggestions that his political enemies be hanged. A semiliterate tailor with no formal education, Johnson rose to political power by aligning himself in his home state of Tennessee with a loyal base of poor mountaineers and small farmers seeking a political champion. He was hated by that era's "Radical Republicans" for his adamant opposition to their attempt to impose racial equality and the rule of law on the defeated Confederacy. Rather than root out the institutional white supremacy that had fueled the Civil War, Johnson thwarted attempts to bring freed slaves equal protection under the law. "Everyone would and must admit that the white race is superior to the black," Johnson said.

How did he become president?
In 1861, Johnson demonstrated a stunning moment of political courage when he became the only senator from a Confederate state to remain loyal to the Union. "Damn the negroes, I am fighting those traitorous aristocrats, their masters," he said. (He owned a few slaves himself.) In an attempt to forge some national unity, President Lincoln, a Republican, appointed Johnson, a pro-Union Democrat, military governor of Tennessee in May 1862. Two years later — with the Civil War still 10 months from conclusion — Lincoln added Johnson to his Republican re-election ticket. But Johnson's start on the national stage was inauspicious. Fighting off a bout of typhoid fever on Inauguration Day, he reinforced himself with three tumblers of whiskey and was visibly drunk when he belligerently called out Cabinet members by name, reminding them that their power derived from the people. His predecessor as vice president, Hannibal Hamlin, yanked on Johnson's coat in a futile effort to stop his jaw-dropping, 17-minute-long diatribe. Forty-two days later, Lincoln was assassinated, and Johnson succeeded him.

How did Johnson respond?
He abandoned Lincoln's agenda. Once elevated, Johnson declared that America "is a country for white men" and guaranteed it would remain as such for "as long as I am president." In a meeting with black abolitionist Frederick Douglass at the White House, he suggested deporting millions of black freedmen. He also flouted Congress by pardoning more than 7,000 Confederates, restoring their property (aside from slaves), and authorizing former rebel states to hold constitutional conventions attended only by white delegates. He accused Radical Republicans of plotting a coup. As he lashed out at critics, opposition to "King Andy," as he was branded, began to crystallize in Congress.

What did Congress do?
Some members searched for evidence connecting Johnson with Lincoln's assassin, John Wilkes Booth. The House investigated Johnson's drinking and whether he frequented prostitutes. In March 1866, Johnson vetoed a civil rights bill that would have granted freedmen citizenship and the right to sue and own land. Both houses of Congress overrode the presidential veto — the first time that ever happened on major legislation.

What happened during his term?
Through the fall of 1866, Johnson toured northern cities to build support for his lenient approach to Reconstruction, casting himself as the only thing standing between whites and "negro domination." He compared himself to Jesus Christ and his pardons for Confederates to divine mercy. When a heckler in Cleveland yelled, "Hang Jeff Davis!" Johnson suggested that his chief political antagonist, Rep. Thaddeus Stevens (R-Pa.), should be hanged instead. An aide begged him to consider the dignity of his office, to which Johnson replied, "I don't care about my dignity." Henry Raymond, publisher of The New York Times, asked, "Was there ever such a madman in so high a place as Johnson?"

What brought on impeachment?
During the tour, Johnson threatened to fire any Cabinet member who opposed him, prompting Congress to pass the Tenure of Office Act prohibiting such dismissals without Senate consent. Matters came to a head in early 1868 when Johnson fired Secretary of War Edwin Stanton, who transferred his belongings to the War Department, barricaded the doors, and refused to leave the building. The House voted 126 to 47 to impeach Johnson on 11 articles. The first eight concerned Stanton's ouster; the ninth Johnson's circumventing of the chain of command by giving orders directly to a general; and the 10th and 11th his conduct and rhetoric in office, saying he had attempted to bring "disgrace, ridicule, hatred, contempt, and reproach" on Congress. The Senate trial began in March 1868 and was the hottest ticket in Washington for a month. In the end, with Walt Whitman watching from the gallery, the Senate fell short of the two-thirds majority needed to remove Johnson by a single vote — that of Sen. Edmund Ross (R-Kan.), who may have been bribed. Johnson completed his term but had little support or authority, and neither party nominated him for re-election.

Congress' struggle to impeach
Then — as is the case today — Congress labored mightily over what constituted an impeachable offense. Should the process be understood narrowly as a criminal proceeding that addressed the breaking of a specific law or, more broadly, as a political mechanism to redress what members saw as Johnson's unfitness for office? Although Johnson's racist rhetoric was not illegal, Sen. Charles Sumner (R-Mass.) framed impeachment as a final battle against slavery. "Driven from these legislative chambers, driven from the field of war, this monstrous power has found refuge in the Executive Mansion," he said. Rep. Thaddeus Stevens called impeachment a "purely political proceeding" that is "intended as a remedy for malfeasance in office and to prevent continuance thereof." In the end, Congress relied primarily on what historian Brenda Wineapple has called "merely a legal pretext" — Johnson's violation of the Tenure of Office Act.