MEXICO CITY (Reuters) - Mexico’s Supreme Court upheld on Monday a Mexico City law allowing married same-sex couples to adopt children in its second landmark gay rights decision this month.

The court on August 5 threw out a challenge led by the federal government to the part of the law approving gay marriage, but only ruled on Monday -- after more than a week of deliberations -- on the legislation’s more controversial adoption provisions.

Mexico City’s left-leaning Mayor Marcelo Ebrard, expected to seek the presidency in 2012, pushed through the legislation this year, making Mexico City the first Latin American capital to extend to same-sex couples the same marriage and adoption rights as heterosexuals.

Mexico’s ruling conservative National Action Party and the Catholic Church strongly opposed both provisions, arguing they would be destructive to traditional families.

“Given that the interests of the child must come first, the proposed reform is constitutional,” said Supreme Court Justice Arturo Zaldivar.

Nine of the court’s 11 judges voted to uphold the law.

Activists see the legislation as part of a sea change in attitudes on homosexuality in much of traditionally conservative Latin America.

Argentina became the first Latin American country to allow gay marriages and adoptions last month when the country’s Senate approved the groundbreaking bill.