MEXICO CITY -- Mexico's Supreme Court voted Monday to uphold a Mexico City law allowing adoptions by same-sex couples.

The justices voted 9-2 against challenges presented by federal prosecutors and others who had argued the law fails to protect adoptive children against possible ill effects or discrimination, or to guarantee their rights to a traditional family.

Justices voting with the majority argued that once same-sex marriages had been approved, it would be discriminatory to consider those couples less capable of parental duties than heterosexual couples.

The court voted earlier this month by the same margin to uphold same-sex marriages themselves under a Mexico City law enacted March 4.

Hundreds of gay and lesbian couples have married under the law, but city officials have not yet reported any applications by those couples to adopt children.

The law applies only in Mexico City, but other states must respect marriages and adoptions made in the capital.

The Roman Catholic Church heatedly opposed the law, and the court voted unanimously Monday to condemn comments by Cardinal Juan Sandoval, the archbishop of Guadalajara, who suggested over the weekend that justices may have been paid off by the Mexico City government to favor the law.

Mexico City's law was the first of its type in Latin America when it was enacted in March.

Argentina became the first country in the region to permit gay marriage in July, when President Cristina Fernandez signed legislation declaring that wedded gay and lesbian couples have all the same legal rights and responsibilities as heterosexual couples, including the right to inheritance and to jointly adopt children.