Texas, settled primarily by Anglo-Americans, fought a successful war of independence against Mexico in 1836. Mexico refused to recognize the independence and warned that annexation to the United States meant war. US Annexation of Texas occurred in 1845; predictably, war followed annexation in 1846. Due to an ambush, the American military was triumphant. As a result of the mexican president at the time, Antonio Lopez de Santa Anna's capture, the newdly United States were able to purchase New Mexico, Arizona, California and adjacent areas. About 60,000 Mexicans remained in the new territories and became US citizens. In 1862, French forces under Napoleon III invaded and conquered Mexico, giving control to the monarch Emperor Maximilian I. Washington denounced this as a violation of the Monroe Doctrine, but was unable to intervene because of the American Civil War. In 1865, the United States stationed a large combat army on the border to emphasize its demand that France leave. France did pull out and Mexican nationalists executed Maximilian.