The war was declared over several times though hostile conflict between the Mexicans and Mayans continued until 1933.

The Caste War of Yucatán (1847–1901) began with the revolt of native Maya people of Yucatán, Mexico against the population of European descent, called Yucatecos, who held political and economic control of the region. A lengthy war ensued between the Yucateco forces in the north-west of the Yucatán and the independent Maya in the south-east. It officially ended with the occupation of the Maya capital of Chan Santa Cruz by the Mexican army in 1901, although skirmishes with villages and small settlements that refused to acknowledge Mexican control continued for more than two decades.

The indigenous population was particularly concentrated in the Campeche-Mérida region, known as the Camino Real, because the majority of the peninsulares and criollos lived in that area. Mayas roughly outnumbered other groups by three to one throughout the Yucatan, but in the east this ratio was closer to five to one. The elites maintained the strictest discipline and control over the Maya population in the east. The Church, generally allied with the stronger classes, also had a preponderant role where the military organization was strongest.

During the Mexican War of Independence, the intelligentsia of Yucatán watched the events to the north, and following 1820 organized their own resistance to Spain, forming the Patriotic Confederation, which declared its own independence from Spain in 1821. The confederation subsequently joined the Mexican Empire that same year, then in 1823 became a part of the federal Mexican government as the Federated Republic of Yucatán. The government of the republic tended towards centralization, and several provinces revolted against it, including Guatemala in the south and Texas in the north. To bear the costs of the war against Texas, the government imposed a variety of taxes including raising importation duties on many items and even taxed the movement of local goods.

In response to this, on 2 May 1839, a federalist movement led by Santiago Imán created a rival government in Tizimín, which soon took over Valladolid, Espita, Izamal and, finally Mérida. To increase his strength, Imán appealed to the Maya population, providing them with arms for the first time since the conquest, and promised that he would give them land free of tribute and exploitation. These forces allowed him to prevail in battle, and in February 1840, he proclaimed Yucatan's return to a federal regime, then in 1841, an independent republic.

However, the Mexican government of Antonio López de Santa Anna, did not accept this independence and invaded Yucatán in 1842, establishing a blockade. Land invasion followed, but the Mexican forces were frustrated in their attempts to take either Campeche or Mérida, and thus withdrew to Tampico.

As Yucatán was struggling against Mexican authority, it was also divided into factions. One faction, based in Mérida, was led by Miguel Barbachano which leaned toward reintegration with Mexico, and the other faction, based in Campeche, was led by Santiago Méndez and feared reintegration would expose the region to attack by the United States, as the Mexican–American War loomed. By 1847, in fact, the Yucatan Republic had effectively two capitals in the two cities. At the same time, in their struggle against the central government, both leaders had integrated large numbers of Maya into their armies as soldiers. The Maya, having taken up the arms given them in the course of the war, decided not to set them down again.

The War seemed rooted in the defense of communal lands against the expansion of private ownership, which was accentuated by the boom in the production of henequen, or agave which was an important industrial fiber used to make rope. After discovering the value of the plant, the wealthier Yucatecos started plantations, beginning in 1833, to cultivate it on a large scale. Not long after the henequen boom, a boom in sugar production led to more wealth. The sugar and henequen plantations encroached on Maya communal land, and Maya workers recruited to work on the plantations were mistreated and underpaid.[1]

However, rebel leaders in their correspondence with British Honduras (Belize) were more often inclined to cite taxation as the immediate cause of the war. Jacinto Pat, for example, wrote in 1848 that "what we want is liberty and not oppression, because before we were subjugated with the many contributions and taxes that they imposed on us."[2] Pac's companion, Cecilio Chi added in 1849, that promises made by the rebel Santiago Imán, that he was "liberating the Indians from the payment of contributions" as a reason for resisting the central government, but in fact he continued levying them.[3]

In June 1847, Méndez learned that a large force of armed Mayas and supplies had gathered at the Culumpich, a property owned by Jacinto Pat, the Maya batab (leader), near Valladolid. Fearing revolt, Mendez arrested Manuel Antonio Ay, the principal Maya leader of Chichimilá, accused of planning a revolt, and executed him at the town square of Valladolid. Furthermore, Méndez searching for other insurgents burned the town of Tepich and repressed its residents. In the following months, several Maya towns were sacked and many people arbitrarily killed. In his letter of 1849, Cecilio Chi noted that Santiago Mendez had come to "put every Indian, big and little, to death" but that the Maya had responded to some degree, in kind, writing "it has pleased God and good fortune that a much greater portion of them [whites] than of the Indians [have died].[4]

Cecilio Chi, the Maya leader of Tepich, along with Jacinto Pat attacked Tepich on 30 July 1847, in reaction to the indiscriminate massacre of Mayas, Chi ordered that all the non-Maya population be killed. By spring of 1848, the Maya forces had taken over most of the Yucatán, with the exception of the walled cities of Campeche and Mérida and the south-west coast, with Yucatecan troops holding the road from Mérida to the port of Sisal. The Yucatecan governor Miguel Barbachano had prepared a decree for the evacuation of Mérida, but was apparently delayed in publishing it by the lack of suitable paper in the besieged capital. The decree became unnecessary when the republican troops suddenly broke the siege and took the offensive with major advances.

Historians disagree on the reason for this defeat. According to some, the majority of the Maya troops, not realizing the unique strategic advantage of their situation, had left the lines to plant their crops, planning to return after planting. It is said that the appearance of flying ants swarming after heavy rains was the traditional signal to start planting for the Maya rebels, leading them, in this instance, to abandon the battle. Others argue that the Maya had not laid up enough supplies for the campaign, and were unable to feed their forces any longer, and their break up was in fact a search for food.

Governor Barbachano sought allies anywhere he could find them, in Cuba (for Spain), Jamaica (for the United Kingdom) and the United States, but none of these foreign powers would intervene, although the matter was taken seriously enough in the United States to be debated in Congress. Subsequently, therefore, he turned to Mexico, and accepted a return to Mexican authority. Yucatán was officially reunited with Mexico on 17 August 1848. Yucateco forces rallied, aided by fresh guns, money, and troops from Mexico, and pushed back the Maya from more than half of the state. By 1850 the Maya occupied two distinct regions in the southeast.

In the 1850s a stalemate developed, with the Yucatecan government in control of the northwest, and the Maya in control of the southeast, with a sparsely populated jungle frontier in between.

In 1850, the Maya of the southeast were inspired to continue the struggle by the apparition of the "Talking Cross". This apparition, believed to be a way in which God communicated with the Maya, dictated that the War continue. Chan Santa Cruz, or Small Holy Cross became the religious and political center of the Maya resistance and the rebellion came to be infused with religious significance. Chan Santa Cruz also became the name of the largest of the independent Maya states, as well as the name of the capital city which is now the city of Felipe Carrillo Puerto, Quintana Roo. The followers of the Cross were known as the "Cruzob".

The government of Yucatán first declared the war over in 1855, but hopes for peace were premature. There were regular skirmishes, and occasional deadly major assaults into each other's territory, by both sides. The United Kingdom recognized the Chan Santa Cruz Maya as a "de facto" independent nation, in part because of the major trade between Chan Santa Cruz and British Honduras, the present day Belize.

The Chan Santa Cruz state, stretching from north of Tulum to the Belize border and a considerable distance inland, was the largest of the independent Maya communities of the era but not the only one. When Jose Maria Echeverria, a sergeant in the army taken captive by the Maya, resided in the town in 1851–53, it had about 200 Maya and 200 whites, all well armed and apparently fighting together, with the whites under their own commander, a man "of reddish complexion". They also had several outlying communities under their control, one contained about 100 people the others unknown numbers.[5] An English visitor in 1858 thought they had 1,500 fighting men in all. He noted that the Santa Cruz went with them and that priests of it were prominent.[6]

The Ixcanha Maya community had a population of some 1,000 people who refused the Cruzob's break with traditional Catholicism. In the years of stalemate, Ixcanha agreed to nominal recognition of Mexico in exchange for some guns to defend themselves from Cruzob raids and the promise that the Mexican government would leave them alone. As Chan Santa Cruz was more of a worry, the Mexicans let Ixcanha govern itself through 1894.

Another important group was the Icaiche Maya, in the jungles of the lower center of the peninsula, who in the 1860s battled against the Mexicans, the Cruzob, and made raids and invasions against British Honduras as well, under their leader Marcos Canul. Canul's forces occupied Corozal Town in 1870 and attacked Orange Walk Town on 1 September 1872. The British mounted a retaliatory raid, including in their weaponry incendiary rockets which set the houses of Icaiche on fire from a good distance away, to the awe of Icaiche's residents. Canul was deposed and the new Icaiche leaders promised respect and friendship with the British. They soon made an agreement with Mexico similar to that of Ixcanha.

Negotiations in 1883 led to a treaty signed on January 11, 1884 in Belize City by a Chan Santa Cruz general and the vice-Governor of Yucatán recognizing Mexican sovereignty over Chan Santa Cruz in exchange for Mexican recognition of Chan Santa Cruz leader Crescencio Poot as Governor of the State of Chan Santa Cruz, but the following year there was a coup d'état in Chan Santa Cruz, and the treaty was declared cancelled.

In 1893 the United Kingdom was enjoying good relations with Mexico's Porfirio Díaz administration, and British investment in Mexico had become of much greater economic importance than the trade between the Cruzob and Belize. The UK signed a treaty with Mexico recognizing Mexican sovereignty over the region, formalizing the border between Mexico and British Honduras, and closing their colony's border to trade with the Chan Santa Cruz "rebels". As Belize merchants were Chan Santa Cruz's main source of gunpowder and guns, this was a serious blow for the independent Maya.

The Mexican army had twice before managed to fight its way to the town of Chan Santa Cruz in previous decades, but was driven back both times. In 1901 Mexican general Ignacio Bravo led his troops to the town to stay, occupied it with a large force and over the next few years subdued surrounding villages. Bravo telegraphed the news that the war was over on May 5th that year. While this is the date most frequently given for the end of the war, fighting continued, although on a smaller scale. With their capital lost, the Cruzob split into smaller groups, often hiding in small hamlets in the jungle, and their numbers were seriously lessened by the epidemics of measles and smallpox that came with General Bravo's troops.

The Chan Santa Cruz Maya, under the influence of the persistent Talking Cross sect, remained actively hostile well into the twentieth century. For many years, any non-Maya who entered the jungles of what is now the Mexican state of Quintana Roo would have been killed. The combination of new economic factors such as the appearance of the Wrigley Company's chicle hunters and the political and social changes resulting from the Mexican Revolution eventually reduced the hatred and hostility. In one form or another, war and armed struggle had continued for more than 50 years and an estimated 40,000 – 50,000 people had died in the hostilities.

The war was officially declared over for the final time in September 1915 by General Salvador Alvarado. General Alvarado, sent by the revolutionary government in Mexico City to restore order in Yucatán, implemented reforms which more or less eliminated the conflicts that had been the cause of the wars.

Although the war had been declared over many times before in previous decades, records show that the last time the Mexican army considered it necessary to take by force one of the area's villages which had never recognized Mexican law was in April 1933, when five Maya and two Mexican soldiers died in the battle for the village of Dzula – the last skirmish of a conflict lasting over 85 years.