Johnston rejoined the U.S. army for the Mexican–American War. By 1860 he was in charge of the U.S. army in California. He resigned in May 1861 after Texas joined the Confederate States of America. He was made a four star general in the Confederate army and put in charge of the Confederate units in Kentucky and Tennessee. He was killed at the Battle of Shiloh on April 6, 1862.