Beauregard graduated from the U.S. Military Academy at West Point, New York (1838), and served in the Mexican-American War (1846–48) under the command of Winfield Scott. After the secession of Louisiana from the Union (January 1861), Beauregard resigned from the U.S. Army and was commissioned a brigadier general in the Confederate army; he eventually became one of the eight full generals of the Confederacy and participated in almost every important theatre of the war. He commanded the forces that bombarded Fort Sumter, South Carolina, was on the field at the First Battle of Bull Run (1861), and assumed command at Shiloh after the death of General Albert Sidney Johnston (1862). He later conducted the defense of Charleston and toward the end of the war defended the southern approaches to Richmond. Though he proved to be a capable combat commander and often displayed sound strategic sense, Beauregard revealed serious deficiencies as a general officer. His penchant for questioning orders bordered on insubordination.