Independence
In 1811 there was an unsuccessful revolt against Spain. In 1821, however, Spanish rule was ended almost without bloodshed. The captaincy general of Guatemala, including all of Central America, became part of the Mexican Empire. When this empire collapsed in 1823, Nicaragua and four other provinces declared their independence as the United Provinces of Central America. This confederation fell apart during the period 1838–39. Nicaragua became independent in 1838.

