In the 1821 Declaration of Independence of the Mexican Empire, both Mexico and Central America declared their independence after three centuries of Spanish rule and formed the First Mexican Empire, although Central America quickly rejected the union.
The new Mexican Empire offered the crown to Ferdinand VII or to a member of the Spanish royal family that he would designate.