 The region was known as "Apachería" by the Spaniards In 1821, the Mexican War of Independence between Mexico and Spain came to an end and the territory of New Spain, which included Arizona, was ceded to Mexico.In 1846, the United States declared war against Mexico in what became known as the Mexican–American War.The conflict with Mexico ended in 1848.