Just hours after the court's decision, Gov. Alejandro Garcia Padilla signed an executive order requiring government agencies to become compliant with the ruling within 15 days. As a result, the island's Health Department is expected to begin issuing marriage licenses by early next month.

Justice Secretary Cesar Miranda said that while it was not immediately clear whether the ruling also meant that gay couples in Puerto Rico could now adopt, he said he would accept and support the change.

Miranda praised the Supreme Court ruling as "a huge step in the quest for equal rights. You cannot deny people the right to love."

All U.S. Supreme Court rulings apply in the U.S. territory.

Several gay couples in Puerto Rico previously had filed a lawsuit challenging local laws including those that prohibit same-sex marriage and the recognition of such marriages. The island's Justice Department originally fought the lawsuit but announced earlier this year it would no longer defend the laws. The case then was put on hold pending a Supreme Court ruling.

Supporters of the ruling gathered at the seaside Capitol building to celebrate, while religious leaders across the island rejected it.

Monsignor Daniel Fernandez, Catholic bishop of the northern city of Arecibo, said he would continue to protect the institution of marriage as it is meant to be: "By nature, marriage exists and can only exist between a man and a woman," he said.

Garcia acknowledged opponents in a statement, saying, "I ask all of those who are people of faith like me to understand that no one is allowed to impose their religious beliefs on others."

Some lamented that Puerto Rico did not take the initiative to allow gay marriage, and they asked the government to ensure that other marginalized groups including transgender people also receive equal treatment.

"It's time to truly make Puerto Rico into a more fair and equal society, and not depend on decisions from the outside to achieve this," said Jose Rodriguez, spokesman for the group Heterosexuals in Favor of Equality.