MEXICO CITY (Reuters) - Mexico’s supreme court on Thursday upheld a landmark law that allows gay marriage in the capital city, bucking a challenge raised by the conservative government of President Felipe Calderon.

This year, Mexico City became the first capital in mainly Catholic Latin America to pass a law allowing gay couples the same marriage and adoption rights as heterosexuals.

But Calderon’s government and his right-wing National Action Party, or PAN, argued the law was unconstitutional on grounds it would be destructive to families. The powerful Catholic hierarchy in Mexico calls gay marriage immoral.

While the supreme court decided gay marriage was constitutional, it will review the adoption clause on Monday.

“Those of us who are in favor of this (law) are in favor of diversity and tolerance,” Supreme Court Justice Arturo Zaldivar said during the court’s deliberations.

“Our constitution does not establish a concept of marriage,” he said.

Since the law was passed, more than 300 same-sex couples have tied the knot, the majority of them men.

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

Argentina this year passed a law allowing gay marriage nationwide, the first such measure in the region. Neighboring Uruguay allows same-sex couples to adopt under civil unions, but not to marry.

Mexico City’s bill was pushed through by leftist Mayor Marcelo Ebrard, who has backed other liberal measures like the legalization of abortion, which remains illegal in most cases across the rest of the country.

With some 20 million residents, the Mexico City metropolitan area is one of the world’s largest cities.