The court, which voted on the measure on Wednesday night, said that the laws were discriminatory and must be immediately changed.

Magistrate Fernando Castillo told reporters that the ban was inconsistent with an opinion issued in January by the Inter-American Court of Human Rights that said homosexual couples must have the same rights to marry as heterosexual couples.

"We continue to deploy actions that guarantee no person will face discrimination for their sexual orientation or gender identity, and that the state's protection be given to all families under equal conditions," he wrote on Twitter.

Enrique Sanchez, the country's first openly gay member of the legislature, said he thinks lawmakers won't be able to agree on a new law within the next year and a half.

"What I see happening is that the norm [the gay-marriage ban] will simply be declared unconstitutional in 18 months' time," Sanchez said.

The court ruling didn't sit well with some evangelical politicians, with lawmaker Jonathan Prendas saying that the court's decision "put a gun to our head" to change the law.

Related Subjects

Costa Rica, which has a strong Catholic tradition, has seen a rise in evangelical churches in recent decades. Evangelical lawmakers currently fill 14 of the Legislative Assembly's 57 seats. Gay marriage was a highly contested issue during the country's presidential election in April this year.

rs/rt (AP, AFP)

Society

2001, The Netherlands

The Netherlands was the first country in the world to permit same-sex marriages after the Dutch parliament voted for legalization in 2000. The mayor of Amsterdam, Job Cohen, wedded the first four same-sex couples at midnight on April 1, 2001 when the legislation came into effect. The new law also allowed same-sex couples to adopt children.

Society

2003, Belgium

The Netherlands' neighbor, Belgium, followed the Dutch lead and legalized same-sex marriage two years later. The law gave same-sex partners many of the rights of their heterosexual counterparts. But unlike the Dutch, the Belgians did not initially allow same-sex couples to adopt children. The Belgian parliament passed a bill granting them that right three years later.

Society

2010, Argentina

Argentina became the first Latin American country to legalize same-sex marriages when its Senate voted 33 to 27 in favor of it in July 2010. Argentina thereby became the tenth country in the world to permit gay and lesbian marriages. The South American country was not the only one to do so in 2010. Earlier in the year, Portugal and Iceland also passed same-sex marriage legislation.

Society

2012, Denmark

Denmark's parliament overwhelmingly voted in favor of legalization in June 2012. The small Scandinavian country had made headlines before when it was the first country in the world to recognize civil partnerships for gay and lesbian couples in 1989. Same-sex couples had also enjoyed the right to adopt children since 2009.

Society

2013, New Zealand

New Zealand became the 15th country worldwide and the first Asia-Pacific country to allow gay and lesbian marriages in 2013. The first couples were married on August 19. Lynley Bendall (left) and Ally Wanik (right) were among them when they exchanged vows on board an Air New Zealand flight from Queenstown to Auckland. France legalized same-sex marriage the same year.

Society

2015, Ireland

Ireland made headlines in May 2015 when it became the first country in the world to legalize same-sex marriage through a referendum. Thousands of people celebrated in the streets of Dublin as the results came in showing almost two-thirds of voters opting for the measure.

Society

2015, USA

The White House was alight in the colors of the rainbow flag on June 26, 2015. Earlier, the US Supreme Court ruled 5 to 4 that the constitution guaranteed marriage equality, a verdict that paved the way for same-sex couples to be married across the country. The decision came 12 years after the Supreme Court ruled that laws criminalizing gay sex were unconstitutional.

Society

2017, Germany

Germany became the fifteenth European country to legalize gay and lesbian marriages in June 30, 2017. The bill passed by 393 to 226 in the Bundestag, with four abstentions. German Chancellor Angela Merkel voted against the bill, but paved the way for its passage when she said her party would be allowed to vote freely on the measure only days before the vote took place.

Society

2017 - 2018, Australia

Following a postal survey which showed the majority of Australians were in favor of same-sex marriage, the country's parliament passed a law to legalize it in December 2017. As couples in Australia have to give authorities one month's notice of their nuptials, many of the first weddings took place just after midnight on January 9, 2018 - including that of Craig Burns and Luke Sullivan, pictured.