On September 13, 1847, he received a lieutenant colonel's brevet for his bravery in the storming of Chapultepec. Said to have been "the wittiest man in the old army," he was a great favorite of General Scott's. He resigned from the United States Army on April 20, 1861, and was commissioned a brigadier general in the Confederate service, and was then quickly promoted to major general. While commanding Confederate forces at Yorktown, Virginia, Magruder completely deceived George B. McClellan as to his strength and caused the Union commander weeks of needless delay. Lack of aggressiveness during the Seven Days Battles cost him the favor of Robert E. Lee, however, and he was soon reassigned to the command of the District of Texas, New Mexico, and Arizona. He arrived in Texas on October 10, 1862, and assumed command on November 29. From his headquarters in Houston, Magruder ably administered his department and was generally popular with the citizens of the region, despite occasional clashes with the governor, especially over the enforcement of conscription laws. His greatest success was his brilliant recapture of Galveston on January 1, 1863, and the consequent if temporary dispersal of the Union blockading fleet. On August 17, 1864, however, he was transferred to the command of the Department of Arkansas and was superseded in Texas by Gen. John G. Walker.
On March 31, 1865, Confederate president Jefferson Davis returned Magruder to the command of the District of Texas, New Mexico, and Arizona, but only in time to witness Gen. Edmund Kirby Smith's surrender of the Trans-Mississippi Department at Galveston on June 2, 1865. After the war Magruder offered his sword to the Emperor Maximilian of Mexico, but after the collapse of the imperial forces he returned to Texas to make his home in Houston, where he died on February 19, 1871. According to John N. Edwards, with whom he traveled Mexico, "Magruder was a born soldier...He would fight all day and dance all night. He wrote love songs and sang them, and won an heiress rich beyond comparison." Magruder spoke with a lisp. He was six feet tall and "in full regimentals" was said to have been "the handsomest soldier in the Confederacy." He married Esther Henrietta von Kapff on May 18, 1831. For the first nineteen years he saw his family in Baltimore only on occasional furloughs. After 1850 his wife visited him only twice, 1854-55 and 1856. Many thought he was single. He is buried in Galveston, the scene of his greatest military success.
29° 17.624, -094° 48.674
Trinity Episcopal Cemetery