Mexico was a colony.
Mexico . In 1521 , the Spanish Empire conquered and colonized the territory from its base in Mexico-Tenochtitlan , which was administered as the viceroyalty of New Spain . Three centuries later , this territory became Mexico following recognition in 1821 after the colony 's Mexican War of Independence .