At least three great civilizations—the Mayas, the Olmecs, and the Toltecs—preceded the wealthy Aztec empire, conquered in 1519–1521 by the Spanish under Hernando Cortés. Spain ruled Mexico as part of the viceroyalty of New Spain for the next 300 years until Sept. 16, 1810, when the Mexicans first revolted. They won independence in 1821.