Andrew Johnson was impeached in 1868 because he decided to dismiss Edwin M. Stanton (a radical Republican) and appoint Ulysses S. Grant in his place as secretary of war.
Why Such A Big Fuss About a Dismissal?
President Johnson had a Reconstruction program that was very lenient toward the defeated South in rejoining the Union. The Radical Republicans in Congress were not happy with this and passed the “Tenure of Office Act” in March 1867, over the president's veto. This Act was designed to protect radical members from dismissal and specified that the president was not allowed to remove officials that were confirmed by the Senate, without the Senate's approval. President Johnson felt that this Act was unconstitutional and wanted to test its constitutionality by taking it to court. The U.S. Supreme Court however refused to rule on this case and the House of Representatives initiated impeachment proceedings against him instead.
President Andrew Johnson was in the end acquitted, but only by one vote as the Senate voted 19 not guilty, 35 guilty, which meant they didn't have the two-thirds majority necessary to convict him. Decades later, during a 1926 case, the Supreme Court confirmed that the Tenure of Office Act was not valid.