The Inter-American Court of Human Rights ruled that the 20 countries under its jurisdiction must enact marriage equality if they haven't already done so.

An international court has ruled that 20 Latin American and Caribbean countries must enact marriage equality.

The Inter-American Court of Human Rights, based in San Jose, Costa Rica, ruled Tuesday that all its signatory countries must grant same-sex couples the same rights as opposite-sex ones, reports Costa Rica’s Tico Times.

The order covers Argentina, Barbados, Bolivia, Brazil, Chile, Colombia, Costa Rica, Ecuador, El Salvador, Guatemala, Haiti, Honduras, Mexico, Nicaragua, Panama, Paraguay, Peru, the Dominican Republic, Suriname, and Uruguay. Some of them already have marriage equality, including Argentina, Brazil, Colombia, Uruguay, and some parts of Mexico, but most do not. Some of them offer civil unions, but the court said a separate arrangement for same-sex couples is not acceptable.

Costa Rican President Luis Guillermo Solis, who had promised to expand LGBT rights in his nation, had asked the court two years ago to rule on marriage equality, and today’s decision is its response, Reuters reports. The Costa Rican government praised the ruling, with Vice President Ana Helena Chacon telling a press conference, “The court ... reminds all states on the continent, including ours, of their obligation and historical debt toward this population,” according to Reuters. There were celebratory rallies in Costa Rica and throughout the region.

The court recommended that nations that do not yet have marriage equality enact it by decree while working out legislative changes, the Tico Times reports. It acknowledged that there may be faith-based opposition to same-sex marriage in these heavily Catholic countries, but said that “in democratic societies, there should exist mutually peaceful coexistence between the secular and the religious.”

The court is part of the Organization of American states. The countries affected by its ruling are all signatories to the American Convention on Human Rights, a multilateral treaty adopted in 1969.