The couples registered to get married as soon as the law came into effect
Five same-sex couples have tied the knot in Mexico City under Latin America's first law that explicitly approves gay marriage.
Mayor Marcelo Ebrard was a guest of honour at the weddings, held in the colonial-era city hall and conducted by the head of the city's civil registry.
The Catholic Church and conservative groups have opposed the move, which was backed by city legislators in December.
Certain parts of Latin America allow civil unions for same-sex couples.
Among the couples to marry were Judith Vazquez and her partner of more than six years Lol-kin Castaneda.
Raising her thumb, with which she had marked the official documents, Ms Vazquez said: "This is the mark of freedom."
'Victory for all'
She said she and Ms Castaneda had previously considered themselves married, but still wanted official recognition.
"The difference today is that the state will recognise it," she said.
"This is a victory for all. For us this is a day of celebration."
Ms Castaneda added: "We are putting a face on a reality that has been denied, silenced and hidden."
Judge Hegel Cortes, who officiated at the weddings, said it was a "historic day" for Mexico City.
"With the signing of these marriage certificates, we leave behind the traditional idea of a family and we allow for two people, regardless of sexual orientation, to get married," he said.
Mexican gay rights groups say homophobia is still widespread
The building's courtyard was decorated with flowers, banners in the colours of the Mexican flag and a sign that read "Tolerance, Liberty, Equality, Solidarity".
The couples all handed in their papers to get married as soon as the law came into effect on 4 March.
Despite happy scenes inside the venue, about 20 protesters gathered outside holding banners denouncing gay marriage.
"This is not a good image for our children. A family is a man and a woman," said Terese Vasquez, 51.
Gay right activists have welcomed the new law in Mexico City but say homophobic attacks are still frequent across the country.
Harsh criticism of the move came from the Catholic Church, conservative groups and the centre-right government, which tried unsuccessfully to get the Supreme Court to block the law.
In Latin America, only Uruguay has legalised civil unions nationwide and allowed same-sex couples to adopt children.
A handful of cities - in Argentina, Ecuador and Colombia - allow gay unions.