He served as an engineer during the Mexican-American War and was appointed superintendent of West Point in 1860, but he resigned at the outbreak of the American Civil War to join the Confederacy. As commander at Charleston, he ordered the first shot of the war against the Union-held Fort Sumter. Beauregard was the field commander in the Confederate victory at the first battle of Bull Run (1861) before being promoted to full general and sent to the western theatre, where, after the battle of Shiloh (1862), he commanded the Army of Tennessee.