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.