The history of the Catholic Church in Mexico dates from the period of the Spanish conquest (1519–21) and has continued as an institution in Mexico into the twenty-first century. Catholicism is one of many major legacies from the Spanish colonial era, the others include Spanish as the nation's language, the Civil Code and Spanish colonial architecture. The Catholic Church was a privileged institution until the mid nineteenth century. It was the sole permissible church in the colonial era and into the early Mexican Republic, following independence in 1821. Following independence, it involved itself directly in politics, including in matters that did not specifically involve the Church.
In the mid-nineteenth century the liberal Reform brought major changes in church-state relations. Mexican liberals in power challenged the Catholic Church's role, particularly in reaction to its involvement in politics. The Reform curtailed the Church's role in education, property ownership, and control of birth, marriage, and death records, with specific anticlerical laws. Many of these were incorporated into the Constitution of 1857, restricting the Church's corporate ownership of property and other limitations. Although there were some liberal clerics who advocated reform, such as José María Luis Mora, the Church came to be seen as conservative and anti-revolutionary. During the bloody War of the Reform, the Church was an ally of conservative forces that attempted to oust the liberal government. They also were associated with the conservatives' attempt to regain power during the French Intervention, when Maximilian of Habsburg was invited to become emperor of Mexico. The empire fell and conservatives were discredited, along with the Catholic Church. However, during the long presidency of Porfirio Díaz (1876–1911) the liberal general pursued a policy of conciliation with the Catholic Church; though he kept the anticlerical articles of the liberal constitution in force, he in practice allowed greater freedom of action for the Catholic Church. With Díaz's ouster in 1911 and the decade-long conflict of the Mexican Revolution, the victorious Constitutionalist faction led by Venustiano Carranza wrote the new Constitution of 1917 that strengthened the anticlerical measures in the liberal Constitution of 1857.