 In 1821, the country 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 dissolution 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.In the 20th century, El Salvador had endured chronic political and economic instability characterized by coups, revolts, and a succession of authoritarian rulers.