Arizona was proclaimed a Confederate territory on August 1, 1861, after Colonel John R. Baylor's victory at the Battle of Mesilla. His hold on the area was broken after Glorieta Pass (March 26–28, 1862), the defining battle of the New Mexico Campaign. In July 1862, the Confederate territorial government withdrew to El Paso, Texas. With the approach of Union troops, it relocated to San Antonio, where it remained for the duration of the civil war. The territory continued to be represented in the Confederate States Congress, and Confederate troops continued to fight under the Arizona banner until the war ended.