In September, 1821 Central America became independent from Spain. The newly formed nation, ruled from Guatemala, dissolved quickly as the countries were not able to unify and were absorbed by Mexico. After Mexico has its own political problems, the Republic of Central America was formed in 1823.
It only lasted until 1840 after Nicaragua, Honduras and Costa Rica separated and formed their own countries. Note that a large chunk of Nicaragua was part of Honduras at the time of this map. This area, the Mosquito (or Miskitu) Coast was part of a British protectorate, then was variously part of the two nations and now split between them. Here is a map of the area as an autonomous region.