The bill calls for a change in the definition of marriage in the city’s civic code, from the union of a man and a woman to “the free uniting of two people.”
City legislators passed the bill 39-20 on Monday with five lawmakers absent. Outside, gay rights activists cheered, exchanged hugs and kisses and waved rainbow flags.
Lawmaker David Razu had proposed the change to give same-sex couples the same rights as heterosexual couples regarding social security and other benefits.
When he introduced the bill last month, Razu said that gays and lesbians “pay taxes like everyone else, obey the law like everyone else, build the city like everyone else, and there is no reason they should have a different and special set of rules.”
Opposition to the measure in the city’s legislature came mainly from the conservative National Action Party of President Felipe Calderon, and the Roman Catholic Church.
The church labeled the proposal immoral, saying marriage must hold the promise of procreation.
The bill now goes to Leftist Mexico City Mayor Marcelo Ebrard, who is widely expected to sign the decision into law.
Under the new law, same-sex marriages can be officiated 45 days after the approval of the measure, likely by February.