
The history of El Salvador begins with several Mesoamerican nations, especially the Cuzcatlecs, as well as the Lenca and Maya. In the early 16th century, the Spanish Empire conquered the territory, incorporating it into the Viceroyalty of New Spain ruled from Mexico City. In 1821, El Salvador achieved independence from Spain as part of the First Mexican Empire, only to further secede as part of the Federal Republic of Central America two years later. Upon the republic's isolation in 1841, El Salvador became sovereign until forming a short-lived union with Honduras and Nicaragua called the Greater Republic of Central America, which lasted from 1895 to 1898.