In 1861, Banks was appointed a major general, given his contributions to the Federal cause, and he was put in charge of the Army of the Shenandoah. During the 1862 Shenandoah Valley campaign, "Stonewall" Jackson defeated Banks at Front Royal and at Winchester. A portion of Jackson'³ army pursued Banks north as far as Harper'³ Ferry. In August 1862, Banks was defeated again by Jackson at the Battle of Cedar Mountain. Next, he received command of the defenses of Washington D.C. where he helped to organize and reinforce its massive defensive system of forts and trenches to prevent an enemy attack. In December 1862, he was made the commander of the Department of the Gulf, under orders to ascend the Mississippi River to join forces with Grant, against the Confederate stronghold of Vicksburg, Mississippi. In the summer of 1863, he commanded the Union forces in the siege of Port Hudson, Louisiana. Its surrender gave the Union control over the entire Mississippi River. In fall 1863, he served on the coast of Texas, to prevent an alliance between Mexico and the Confederacy. In 1864, he supported the US Navy in the Red River campaign into Louisiana and Arkansas. The Red River campaign ended in a Union failure and was General Banks last active command. Removed from field command, President Lincoln placed Banks on leave in Washington until the end of the war.