Gay rights activists across the world consider same-sex marriage one of their toughest goals. Only seven countries permit it: Belgium, Canada, Norway, the Netherlands, Spain, South Africa and Sweden. A handful of US states also allow it.
But on Monday night, and despite opposition from conservatives and the Roman Catholic church, Mexico City was in the vanguard of a Latin America-wide tilt towards greater tolerance for homosexuality. The Mexican capital became the first in Latin America to allow same-sex marriage with a groundbreaking law which could set a precedent for gay rights across the region.
The city's assembly passed the legislation, which will also give gay couples the right to adopt children, in a dramatic vote that triggered celebrations and chants of "yes we can" from activists gathered in the chamber.
Argentina, Colombia and Uruguay have made recent moves towards liberalisation and debate is stirring in other countries, emboldening gays to emerge from the closet and challenge traditional macho stereotypes. The trend contrasts with recent votes against same-sex marriage in the United States, notably California, Maine and New York, which have dismayed activists.
Mexico's leftist Democratic Revolution party (PRD) pushed the bill through the capital's assembly 39-20, changing the city's civil code definition of marriage from the union of a man and a woman to the "free uniting of two people".
The change will permit same-sex couples to adopt children, apply for joint bank loans, inherit wealth and share insurance policies. It is a significant expansion of rights granted under a 2006 law allowing same-sex civil unions.
The mayor, Marcelo Ebrard, a crusading leftist from the PRD, was expected to sign the measure into law, paving the way for the region's first married gay couple. Activists inside the chamber cheered and waved rainbow banners, scenes repeated outside as news spread. "We are so happy," Temistocles Villanueva, a 23-year-old film student, told Associated Press, as he embraced and kissed his boyfriend.
Victor Romo, a member of the mayor's party, called it a historic day. "For centuries unjust laws banned marriage between blacks and whites or Indians and Europeans. Today all barriers have disappeared."
Conservatives condemned the change as an affront to those who lived outside the capital's liberal bubble. Cardinal Norberto Rivera Carrera said the law was immoral and that "innocent children" could be adopted by gay couples. President Felipe Calderón's National Action party said it would try to block the law.
"They have given Mexicans the most bitter Christmas," Armando Martínez, the president of the College of Catholic Attorneys, told reporters. "They are permitting adoption [by gay couples] and in one stroke of the pen have erased the term 'mother' and 'father'. "
Latin American governments have historically persecuted gay men and lesbians. Fidel Castro's Cuba as well as rightwing dictatorships were openly homophobic and punished gays as deviants from a macho ideal.
Discrimination remains widespread, and the minority is still vulnerable. Walter Orlando Trochez, 27, a prominent gay and anti-coup activist in Honduras, was shot dead last week. Transgender sex workers across the region often complain of violent attacks by police and vigilantes.
But in the last two decades attitudes have softened. The proportion who said they would not like to have homosexuals as neighbours plunged from 59% in 1995 to 29% this year, according to a Latinobarómetro poll taken in 18 countries across the region.
"Tolerance towards homosexuals has been the value dimension that has changed the most in the 15 years that we have been measuring," said Marta Lagos, the Chile-based pollster's founding director. "The vast majority – 70% – of the Latin American population tolerates homosexuals. Fifteen years ago it was the complete opposite."
Lagos attributed the change to societies becoming more developed and people becoming more expressive. That did not mean progressive values were prevailing across the board: 36% said women should stay at home rather than work, the same proportion as in 1997. Opposition to abortion also remained high. "It doesn't mean Latin American societies are becoming more similar to European societies," said the pollster.
Tolerance is most visible in capitals, with the likes of Buenos Aires, Bogotá and Mexico City boasting gay-friendly districts where same-sex couples have no fear of showing affection in public. Argentina's capital has opened Axel, Latin America's first luxury hotel aimed at gays. In a neat twist, it has declared itself "heterosexual friendly".
Buenos Aires legalised same-sex civil unions in 2002 but conflicting judicial rulings recently stymied same-sex marriages. Several other Argentine cities, as well as Mexican and Brazilian states, also permit same-sex unions. Uruguay has become the first Latin American country to recognise such unions and permit adoption by gay couples. Colombia has granted social security rights to gay couples; its neighbour Venezuela is considering same-sex civil unions.
"Before, if you said you were gay, you were dead," said Alberto Rodriguez, a beautician from Venezuela. "But now we're more accepted. We hold events, parades and fashion shows."