Same-sex marriage is legally recognized and performed throughout Mexico since 2022. On 11 August 2010 the Supreme Court of Justice of the Nation ruled that same-sex marriages performed anywhere within Mexico must be recognized by the 31 states without exception, and fundamental spousal rights except for adoption (such as alimony payments, inheritance rights, and the coverage of spouses by the federal social security system) have also applied to same-sex couples across the country. Mexico was the fifth country in North America and the 33rd worldwide to allow same-sex couples to marry nationwide.

Only civil marriages are recognized by Mexican law, and all proceedings fall under state legislation. On 12 June 2015, the Supreme Court of Justice of the Nation ruled that state bans on same-sex marriage violate the federal constitution. The court's ruling is considered a "jurisprudential thesis" and did not invalidate any state laws, but required judges and courts throughout Mexico to approve all applications for same-sex marriages, and any marriage law that was changed and did not recognize same-sex marriage would be declared unconstitutional and invalidated.

By October 2022, Mexico City and all Mexican states had legalized same-sex marriage, either by legislation, executive action, or Supreme Court order. However, marital rights are not necessarily equal when it comes to adoption: only 22 of the 31 states, plus Mexico City, have civil codes that allow same-sex couples to adopt, though in other states same-sex couples can adopt through the court system under jurisprudence established by the Supreme Court. In 2 of the 31 states, marriage licenses are issued to same-sex couples despite not being allowed under state law; they may take more time to process or be more expensive than licenses for opposite-sex couples, and there is a possibility that future administrations might stop issuing licensees.

Same-sex civil unions (, ) are legally performed in Mexico City and in the states of Campeche, Coahuila, Michoacán, Tlaxcala and Veracruz. From 2013 to 2016, they were also performed in the state of Colima, but were replaced by same-sex marriage legislation. They were also performed in Jalisco beginning in 2014, but the law was struck down on procedural grounds in 2018.

History On 9 November 2006, after several years of consideration, the Legislative Assembly of Mexico City approved a civil union law called Ley de Sociedades de Convivencia. It was the first such law in Mexico, soon followed by the northern state of Coahuila in January 2007.

In late November 2009, the leading party in the Legislative Assembly of Mexico City, the Party of the Democratic Revolution (PRD), announced that it was introducing an amendment to the Civil Code to legalize same-sex marriage in Mexico City, a project endorsed by the local Head of Government, Marcelo Ebrard, but strongly opposed by the second-largest political force in the country, the right-of-center National Action Party (PAN) and the Roman Catholic Church. The bill found support from over 600 non-governmental organizations, including the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA) and Amnesty International. On 21 December 2009, Mexico City became the first Latin American jurisdiction to legalize same-sex marriage. The law became effective on 4 March 2010. On 5 August 2010, the Supreme Court voted 8–2 to uphold the constitutionality of Mexico City's same-sex marriage law. The Court later ruled on 10 August 2010 that Mexico City marriages are valid throughout the entire country.

On 28 November 2011, the first two same-sex marriages occurred in Quintana Roo after discovering that the state's Civil Code did not explicitly prohibit same-sex marriage, but these marriages were later annulled by the Governor of Quintana Roo in April 2012. In May 2012, the Secretary of State of Quintana Roo reversed the annulments and allowed for future same-sex marriages to be performed in the state.

A 2012 Oaxaca case was pivotal in opening the door to legal same-sex marriage in every state in Mexico, through the recurso de amparo process. Using international decisions, whose verdicts serve as legal precedent in Mexican courts, such as the protections in the Atala Riffo and Daughters v. Chile case, the U.S. cases Loving v. Virginia and Brown v. Board of Education and Mexico's own anti-discrimination laws, the Supreme Court ruled on 5 December 2012 that: 1) Laws limiting marriage to one man and one woman, or for the purposes of perpetuating the species, violate federal law requiring that they "correspond to all persons without any distinction" and 2) That such laws are unconstitutional on the basis of discrimination by sexual orientation and usurpation of the right, not only of the individual but also the couple's right, to form a family. The ruling did not directly overturn the impugned laws, but established that marriages obtained by injunction (amparo) can be performed in any state, regardless of whether the state Civil Code has been changed.

A landmark decision, issued on 29 January 2014, was the first injunction for marriage recognition in Puebla. The case involved a same-sex couple who legally married in Mexico City in 2012 and filed for spousal benefits with the Mexican Social Security Institute (IMSS) in the state of Puebla, but were denied. Because the complainant died during the injunction process, a lower court had dismissed the case, but the Supreme Court granted the injunction and ordered recognition of the marriage by both the state of Puebla and the IMSS. The injunction required IMSS to extend benefits it offered to married heterosexual couples to same-sex couples anywhere in Mexico who are married or in civil unions.

A ruling by the Supreme Court on 12 June 2015 stated that state bans on same-sex marriage violate Articles 1 and 4 of the Constitution of Mexico. The court's ruling is considered a "jurisprudential thesis" and did not invalidate any state laws, meaning same-sex couples denied the right to wed would still have to seek individual injunctions in court. The ruling standardized the procedures for judges and courts throughout Mexico to approve all applications for same-sex marriages, and made the approval mandatory. The ruling was published in the country's Judicial Gazette on 19 June 2015 and became binding on 22 June 2015. Some have suggested the ruling "effectively legalizes" same-sex marriage in Mexico, though without legislative change, civil registrars are still bound to follow state laws. Indeed, the Supreme Court does not have the legal power to strike down all the states' same-sex marriage bans. It can only do so one at a time and under specific circumstances.

The ruling states:

On 20 December 2015, the National Human Rights Commission submitted a general recommendation to all state executive and legislative bodies, requesting them to allow same-sex marriages in their jurisdictions. The Commission considers differentiated marriage constructions for same-sex couples (such as civil unions) to be discriminatory.

On 17 May 2016, President Enrique Peña Nieto announced he had signed an initiative to amend Article 4 of the Constitution to legalize same-sex marriage nationwide. Any amendment to the Constitution requires support of at least a two-thirds majority in Congress and ratification by a simple majority of the 31 states. He also submitted a bill to make appropriate changes in the Civil Code. Chairman of the Committee on Constitutional Issues of the Chamber of Deputies, Daniel Ordóñez Hernández, announced in June 2016 that the President's initiative would be debated by the committee later in the year. Ordoñez also said that 47,000 letters expressing opposition to the initiative were received though none of them were signed. On 9 November 2016, the committee rejected the initiative by 19 votes to 8.

On 30 November 2016, the Supreme Court unanimously declared that six articles of the Law of the Institute of Social Security and Social Services of State Workers (ISSSTE; ) were unconstitutional because they discriminated against same-sex couples. The Court found that the wording of articles 6, 39, 40, 131 and 135, and sections I and II of the ISSSTE Act violated the rights of same-sex couples to affiliate as beneficiaries of the institute, and thus, those articles violate the principle of equality and non-discrimination established in Articles 1 and 123 of the Constitution. A further ruling issued by the Supreme Court holding that same-sex couples in Mexico have a nationwide right to establish and maintain a family life, whether through procreation, adoption or other means derived from scientific advances, took effect on 30 January 2017.

The 2018 general elections resulted in the National Regeneration Movement (MORENA), a left-wing party that supports same-sex marriage, winning the majority or plurality of legislative seats in 13 states where same-sex marriage was not legal at the time. MORENA along with the Labor Party also won an absolute majority in the Chamber of Deputies and the Senate. In October 2018, shortly after the beginning of the new legislative term, PRD Senator Juan Zepeda Hernández introduced a draft proposal to legalize same-sex marriage nationwide in Mexico. On 18 December 2019, the ruling party introduced a constitutional amendment to legalize same-sex marriage at the federal level, upgrade civil unions to marriage, and require all states to adjust their laws correspondingly within three months of passage.

In September 2018, MORENA Senator Germán Martínez introduced a draft proposal to codify certain court rulings pertaining to the legal rights of same-sex couples into law, namely social security benefits and the right to a widow or widower's pension. On 6 November 2018, the Senate unanimously (110–0) approved the bill, and it unanimously (415–0) passed the Chamber of Deputies later that month. The bill was gazetted on 29 November 2018.

On 19 October 2018, a federal court ruled that Mexico must recognize same-sex marriages performed in Mexican consulates and embassies abroad as long as one partner is a Mexican citizen. The plaintiffs in the case, activist Daniel Berezowsky Ramirez and Jaime Chavez Alor, married at the Mexican consulate in New York City on 26 November. In late November, Senator Ricardo Monreal introduced a bill to Congress to allow same-sex marriages in Mexican consulates without the need for couples to obtain a court injunction. On 16 May 2019, the Secretary of Foreign Affairs issued a decree authorizing same-sex marriages at Mexican consulates.

Constitutional wording The Constitution of Mexico does not explicitly define nor ban same-sex marriage. The Constitution does contain various articles protecting the "integrity of the family" and the "fraternity and equality of rights of all" and forbidding "any form of discrimination, based on [...] sexual orientation, marital status, [...] which violates the human dignity or seeks to annul or diminish the rights and freedoms of the people". For these reasons, the Supreme Court has ruled that banning same-sex marriage is unconstitutional.

Article 4 provides that men and women have an equal right to marry, and states that "the law shall protect the organization and development of the family."

México Igualitario Project