Costa Rica joined the First Mexican Empire of Agustín de Iturbide. After its collapse in 1823, Costa Rica became a province of the new Federal Republic of Central America. it existed from 1823 to 1839. It had a very loose authority over its provinces, especially the poor and remote Costa Rica.