Complex sentence: Shortly after Central America declared independence from the Spanish Empire, some of its countries were annexed by the First Mexican Empire in 1821 and then Central America formed the Federal Republic in 1823.
Split into simpler sentences: Shortly after Central America declared independence from the Spanish Empire, it was annexed by the First Mexican Empire in 1821. When the First Mexican Empire ended, Central America again became independent and formed the Federal Republic in 1823.