SAN JOSE, COSTA RICA -- Costa Rica became the latest country to legalize same-sex marriage early Tuesday when a ruling from its supreme court went into effect ending the country's ban.

Couples held ceremonies -- mostly private due to the COVID-19 pandemic, but some that were broadcast -- to celebrate their unions before judges and notaries after the ban was lifted at midnight.

Daritza Araya and Alexandra Quiros married just after midnight in an outdoor service performed by a notary wearing a face mask who pronounced them "wife and wife." Theirs was the first legal gay marriage in Costa Rica and it was streamed live on the Internet.

Costa Rica is the sixth country in Latin America to legalize same-sex marriage, following most recently Ecuador, which allowed it last year. It is also permitted in some parts of Mexico.

Gay equality activist Marco Castillo married his longtime partner Tuesday morning before a judge.

"This is a step in social equality. The fact that Rodrigo and I are able to come marry each other in a court is progress," Castillo said. "This drives us to continue other fights for those who have a different sexual orientation."

Castillo had fought for gay marriage for years in the courts. He was also recently sanctioned as a notary for conducting the marriage of two women, which was later annulled.

President Carlos Alvarado sent a message on state television and social networks, saying, "Today we celebrate freedom, equality and democratic institutions,.

The issue took centre stage in Costa Rica's 2018 presidential election after the Inter-American Court of Human Rights issued an opinion that countries like Costa Rica, which had signed the American Convention on Human Rights, had to move immediately to legalize gay marriage.

It helped propel President Carlos Alvarado to victory over an evangelical candidate, Fabricio Alvarado, who had campaigned against it.

In August 2018, Costa Rica's supreme court said the country's ban was unconstitutional and gave the congress 18 months to correct it or it would happen automatically. The Legislative Assembly did not act, so at midnight the law banning same-sex marriage was nullified.

A campaign celebrating the change called "I do" planned a series of events including hours of coverage on state television and messages from celebrities, including Michelle Bachelet, the United Nations rgh commissioner for human Rights.

Gia Miranda, director of the "I do" campaign, said television coverage would also include segments on the movement's history in Costa Rica.

"It gives us so much joy," Miranda said. "The only thing that could win with this is Costa Rica and in general love." She said it would help decrease discrimination and make the country more prosperous and attractive to tourists.