Question: who did el salvador get their independence from
Answer: 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 in 1823 .