Commissioned in the Corps of Engineers in 1829, Robert E. Lee held a variety of assignments. Promotion was slow; he did not make captain until 1838. In the Mexican War, he was an engineering officer with Winfield Scott's force that fought its way to Mexico City. His performance in other major battles won praise. From 1852-1855 he was superintendent at West Point, was made lieutenant colonel of the Second Cavalry, and in 1859 commanded the force that suppressed the John Brown raid on Harpers Ferry.
A moderate, Lee was loyalty to his own state of Virginia at the beginning of the Civil War. That loyalty included declining command of the Federal army.
For a while an advisor to Jefferson Davis, he took command of the main Confederate Army in Virginia, which he soon named the Army of Northern Virginia. Lee won his greatest victory at Chancellorsville and suffered his greatest defeat also: the death of Stonewall Jackson. He lost at Gettysburg, although he maneuvered brilliantly. His forces' strength continued to decline, leading to his ultimate surrender at Appomattox Court House. Following the war, he became president of what now is Washington & Lee University. He accepted the results of the war and devoted himself to education and helping to rebuild the South.