The territory of modern Mexico has been inhabited by a number of Indian tribes since ancient times. In 1517-1521. Mexico was subjected to the conquest of the Spanish conquistadors and from 1522 for three centuries was a colony of feudal Spain. In 1821, Mexico gained independence. A period of continuous coups d'etat and military uprisings began, and the United States took advantage of this: in 1845 the USA annexed the state of Texas, and as a result of the war of 1846-1848, they tore off more than half of its territory from Mexico.