All of present-day Arizona became part of the Mexican State of Vieja California upon the Mexican assertion of independence from Spain in 1822. The United States took possession of most of Arizona at the end of the Mexican-American War in 1848. In 1853, the land below the Gila River was acquired from Mexico in the Gadsden Purchase. Starting in 1853, the entirety of present-day Arizona was part of the New Mexico Territory.
During the Civil War, on March 16, 1861, southern New Mexico Territory around Mesilla (now in New Mexico) and Tucson declared itself independent from the United States to join the Confederacy. Confederate Territory of Arizona (CSA) was regarded as a valuable route for possible access to the Pacific Ocean, with the specific intention of joining southern California to the Confederacy. [In 1860, Southern California had cleared all legal hurdles for secession from the rest of California and was waiting reorganization as a new U.S. territory, which never materialized. At that time, sparsely populated Southern California was a hotbed of Southern sympathizers.]
In March 1862, Union troops re-captured the Confederate Territory of Arizona and returned it to the New Mexico Territory. The Battle of Picacho Pass, April 15, 1862, was one of many battles to occur in Arizona during the war. In 1863, the U.S. split up their New Mexico Territory along a north-south border to create the U.S. Arizona Territory, which was later to become the state of Arizona.
During the war, U.S. presidios were moved to New Mexico, leaving Arizona vulnerable to Native American attack. Hostilities between the Native Americans and American settlers began in 1861, lasted until 1886, and led to most Indian tribes’ being moved to reservations.
Mining, cattle and railroads became the central parts of the Arizona economy, leading to boomtowns being formed as prospectors found gold, and the boomtowns’ becoming ghost towns as the miners left. Hispanics, the majority of the population, constituted most of the mining labor force.
The Desert Land Act of 1877, which gave settlers 640 acres of land, caused people to flood into the region.