After independence in 1821, the Federated Republic of Yucatán joined the Mexican federation in May 1823. The new republic comprised the whole Yucatan Peninsula including what is now the states of Campeche and Quintana Roo. It maintained a degree of autonomy in the Mexican federation.
In the mid 1830s President Santa Anna imposed a centrally controlled dictatorship, which imposed significant control over Yucatán. This lead to a rebellion in 1838 seeking Yucatán independence. Negotiations with Santa Anna to give Yucatán more autonomy within the Mexican Republic stumbled.
In 1840 the Yucatán declared full independence as the Republic of the Yucatán. At the time, Santa Anna was preoccupied with rebellions in northern Mexico, but he did blockade Yucatán ports. At the time, there were no land routes between the Yucatán and either Mexico or Central America. In 1843 Mexico sent troops to Yucatán to put down the rebellion. They failed, but the blockade was successful. The young Republic had no navy and no way to trade because its ports were successfully blockaded. It agreed in December 1843 to rejoin Mexico when given assurances of self-rule.
But the assurances of self-rule were not upheld and the Yucatán declared independence again on January 1, 1846. When the Mexican–American War broke out later that year, Yucatán declared neutrality. While Mexico had its hands full fighting the USA, the Yucatán had its own problems. In 1847 the Mayas initiated the Caste War by rebelling against the Hispanic (Criollo) (creole) upper class that controlled the Yucatán Republic.
With its back to the wall in early 1848, the Yucatán Republic offered sovereignty over Yucatán to either USA or Britain or Spain, whichever was first to effectively end the Maya revolt. The USA invoked the Monroe Doctrine to keep the other two out and seriously considered the proposal, but in the end did not accept it.
In a desperate effort to put down the rebellion, the Yucatán Criollos agreed on 17 August 1848 to re-unite with Mexico if the Mexican army would put down the Maya rebellion. Thus the on and off life of the Republic of the Yucatán came to an end. The peninsula remained relatively separate from the rest of Mexico. The first railroad link was established in the 1950s (see earlier post about the first map on a Mexican postage stamp) and the first highway in the 1960s.