Lesbian, gay, bisexual, transgender, and queer (LGBTQ) rights in Mexico expanded in the 21st century, keeping with worldwide legal trends. The intellectual influence of the French Revolution and the brief French occupation of Mexico (1862–67) resulted in the adoption of the Napoleonic Code, which decriminalized same-sex sexual acts in 1871.Dynes, Johansson, p. 806.

Tolerance of sexual diversity in certain indigenous cultures is widespread, especially among Isthmus Zapotecs and Yucatán Mayas.Reding, p. 17.Dynes, Johansson, p. 805. As the influence of foreign and domestic cultures (especially from more cosmopolitan areas such as Mexico City) grows throughout Mexico, attitudes are changing. This is most marked in the largest metropolitan areas, such as Guadalajara, Monterrey, and Tijuana, where education and access to foreigners and foreign news media are greatest. Change is slower in the hinterlands, however, and even in large cities, discomfort with change often leads to backlashes. Since the early 1970s, influenced by the United States gay liberation movement and the 1968 Tlatelolco massacre, a substantial number of LGBTQ organizations have emerged. Visible and well-attended LGBTQ marches and pride parades have occurred in Mexico City since 1979, in Guadalajara since 1996, and in Monterrey since 2001.

On 3 June 2015, the Supreme Court of Justice of the Nation released a "jurisprudential thesis" in which the legal definition of marriage was changed to encompass same-sex couples. Laws restricting marriage to a man and a woman were deemed unconstitutional by the court and thus every justice provider in the nation must validate same-sex unions. However, the process is lengthy as couples must request an injunction () from a judge, a process that opposite-sex couples do not have to go through. The Supreme Court issued a similar ruling pertaining to same-sex adoptions in September 2016. While these two rulings did not directly strike down Mexico's same-sex marriage and adoption bans, they ordered every single judge in the country to rule in favor of same-sex couples seeking marriage and/or adoption rights. By 31 December 2022, every state had legalized same-sex marriage by legislation, executive order, or judicial ruling, though only twenty allowed those couples to adopt children. Additionally, civil unions are performed in the states of Campeche, Coahuila, Mexico City, Michoacán, Sinaloa, Tlaxcala and Veracruz, both for same-sex and opposite-sex couples.

Political and legal gains have been made through the left-wing Party of the Democratic Revolution, leftist minor parties such as the Labor Party and Citizen's Movement, the centrist Institutional Revolutionary Party, and more recently the left-wing National Regeneration Movement. They include, among others, the 2011 amendment to Article 1 of the Federal Constitution to prohibit discrimination based on sexual orientation.

History

Acceptance of homosexuality and transgender identities has been documented among various indigenous peoples of Mexico, most notably the Isthmus Zapotecs and Yucatán Mayas. The Isthmus Zapotecs recognize a traditional third gender, known as muxe, an intermediate between male and female. are assigned male at birth, but typically act and behave like women and do both women and men's work. Having a in the family is perceived as good luck and a blessing. They are often referred to as transgender in English language publications.

Traditionally, Mayan society was relatively tolerant of homosexuality. There was a strong association between ritual and homosexual activity. Some shamans engaged in homosexual acts with their patients, and priests engaged in ritualized homosexual acts with their gods.Peter Herman Sigal. From moon goddesses to virgins: the colonization of Yucatecan Maya sexual desire. p. 213. University of Texas Press, 2000. . Similarly, the Toltecs were also "extremely sex tolerant", with public displays of sex and eroticism, including of homosexual acts.

However, little is known about same-sex relationships in Aztec society. Some sources claim that homosexuality among young Aztec men was tolerated (homosexual acts were commonly practised in temples and before battle), but not among adult men, where the punishment could be death. The penetrated adult male (known as ) would typically be killed through anal impalement but the penetrating male would usually not suffer any punishments. On the other hand, many Aztec nobles and rich merchants had both male and female prostitutes and engaged in same-sex relations, and there were some religious rituals where homosexuality was acceptable, most notably Tezcatlipoca sacrifices. Intersex people (known as ) were regarded as "detestable women" by Aztec society and would be killed. However, some sources suggest that homosexuality was more widely practised and tolerated among the Aztecs and that most of the negativity surrounding the practice stems from Spanish records, as supposedly the Spanish had "huge problems trying to stamp out homosexuality". The Aztec god Xōchipilli is the patron of homosexuals and male prostitutes.Cecelia F. Klein and Jeffrey Quilter, Gender in Pre-Hispanic America. Dumbarton Oaks Research Library and Collection, Washington, D.C.

1970 to present

During the early 1970s, influenced by the U.S. gay liberation movement and the 1968 Tlatelolco massacre, small political and cultural groups were formed. Initially, they were strongly linked to the political left and, to a degree, feminist organizations. One of the first LGBT groups in Latin America was the Homosexual Liberation Front (Frente de Liberación Homosexual), organized in 1971 in response to the firing of a Sears employee because of his allegedly homosexual behavior in Mexico City.Herrick and Stuart, p. 144.

The Homosexual Front of Revolutionary Action (Frente Homosexual de Acción Revolucionaria) protested the 1983 roundups in Guadalajara, Jalisco.Dynes, Johansson, Percy and Donaldson, p. 807. The onset of AIDS during the mid-1980s created considerable debate and public discussion about homosexuality. Many voices, both supportive and opposing (such as the Roman Catholic Church), participated in public discussions that increased awareness and understanding of homosexuality. LGBT groups were instrumental in initiating programs to combat AIDS, which was a shift in focus that curtailed (at least temporarily) the emphasis on gay organizing.

In 1991, Mexico hosted a meeting of the International Gay and Lesbian Association (ILGA), which was its first meeting outside Europe. In 1997, LGBT activists were active in constructing the political platform that resulted in Patria Jiménez (a lesbian activist in Mexico City) being selected for proportional representation in the Chamber of Deputies representing the left-wing Party of the Democratic Revolution (PRD). LGBT rights advocate David Sánchez Camacho was also elected to the Legislative Assembly of the Federal District (ALDF).

In August 1999, the First Meeting of Lesbians and Lesbian Feminists was held in Mexico City. From this meeting evolved an organized effort for expanded LGBT rights in the country's capital.Padilla, p. 207. The following month, the PRD-controlled Legislative Assembly of the Federal District passed an ordinance banning discrimination based on sexual orientation, the first of its kind in Mexico.Reding, p. 27.

Visible (and well-attended) LGBT marches and pride parades have been held in Mexico City since 1979 and in Guadalajara since 1996, the country's largest cities. In 2001, Article 1 of the Federal Constitution was amended to prohibit discrimination based (among other factors) on sexual orientation under the vague term preferences. On 11 June 2003, an anti-discrimination federal law took effect, creating a national council to enforce it.CONAPRED, official website. The same year, Amaranta Gómez ran as the first transgender congresswoman candidate affiliated with the former Mexico Posible party. In June 2011, the more precise term "sexual orientation" was inserted into Article 1 of the Constitution.

LGBT people in Mexico have organized in a variety of ways: through local organizations, marches, and the development of the Commission to Denounce Hate Crimes. Mexico has a thriving LGBT movement with organizations in various large cities throughout the country and numerous LGBT publications (most prominently in Mexico City, Guadalajara, Monterrey, Tijuana, and Puebla), the majority at the local level (since national efforts often disintegrate before gaining traction).Padilla, p. 208.

Timeline of LGBTQ history in Mexico 1542: Hernan Cortés started his campaign in Cholula (now Cholula, Puebla). At that time, Amerindian homosexuality behavior varied from region to region. Cortés on behalf of his majesty the King of Spain started talking to the locals (, translated from old Spanish) and established rules against sodomy.Bernal Díaz, p. 30. 1569: An official inquisition was created in Mexico City by Philip II of Spain. Same-sex sexual acts were a prime concern, and the Inquisition inflicted stiff fines, spiritual penances, public humiliations, and floggings for what it deemed to be sexual sins. 1871: The intellectual influence of the French Revolution and the brief French occupation of Mexico (1862–67) resulted in the adoption of the Napoleonic Code. This meant that sexual conduct in private between adults (regardless of gender) ceased to be a criminal matter. 1901: (20 November) Mexico City police raided an affluent drag ball, arresting 42 men (19 of which were cross-dressing). One was released, allegedly a close relative of President Porfirio Díaz. The resulting scandal, known as the "Dance of the 41 Maricones", received widespread press coverage. 1959: Mayor Ernesto Uruchurtu closed all gay bars in Mexico City under the guise of "cleaning up vice" (or reducing its visibility). 1971: The Homosexual Liberation Front (Frente de Liberación Homosexual), one of the first LGBT groups in Latin America, was organized in response to the firing of a Sears employee because of his (allegedly) homosexual orientation. 1979: The country's first LGBT pride parade was held in Mexico City. 1982: Max Mejía, Pedro Preciado, and Claudia Hinojosa became the first openly gay politicians to run unsuccessfully for seats in the Congress of Mexico. 1991: Mexico hosted a meeting of the International Gay and Lesbian Association, the first meeting of the association outside Europe. 1997: Patria Jiménez, a lesbian activist, was selected for proportional representation in the Chamber of Deputies of Mexico, representing the left-wing Party of the Democratic Revolution. 1999: (August): The first meeting of lesbians and lesbian feminists was held in Mexico City. From this meeting, evolved an organized effort for expanded LGBT rights in the nation's capital. (2 September): Mexico City passed an ordinance banning discrimination based on sexual orientation, the first of its kind in the country. 2000: Enoé Uranga, an openly lesbian politician, proposed a bill that would have legalized civil unions in Mexico City. The local Legislature, however, decided not to enact the bill after widespread opposition from right-wing groups. 2003: (29 April): A federal anti-discrimination law was passed and a national council was immediately created to enforce it. (July): Amaranta Gómez became the first transgender woman to run unsuccessfully for a seat in the Congress of Mexico. 2004: (13 March): Amendments to the Mexico City Civil Code that allow transgender people to change the gender and name on their birth certificates took effect. 2006: (9 November): Mexico City legalized same-sex civil unions. 2007: (11 January): The northern state of Coahuila legalized same-sex civil unions. (31 January): The nation's first same-sex civil union ceremony was performed in Saltillo, Coahuila.