Costa Rica’s Supreme Court has ruled against the country’s same-sex marriage ban, deeming it unconstitutional.

The ruling gives legislators 18 months to change marriage law and grant same-sex couples the right to marry. If they fail to act, the ban against gay marriages will automatically dissolve.

The decision follows a ruling issued in January by the Inter-American Court of Human Rights, under whose jurisdiction the country falls, but a number of Costa Rican legislators have opposed changing marriage law. Of the legislative chamber’s 57 seats, 14 of them are held by evangelicals.

costa rica gay marriage

EZEQUIEL BECERRA/AFP/Getty Images

Enrique Sanchez, the country’s first openly gay legislator, told AFP he did not expect the assembly to work out a change to the law themselves, the BBC reports, meaning it would only come by default after a year and a half wait.

President Carlos Alvarado supports same-sex marriage and ran on a platform that included embracing LGBTQ rights, which was in stark contrast to his opponent, pastor Fabricio Alvarado, who said he would defy the Inter-American Court of Human Rights’ ruling.

gay marriage costa rica

EZEQUIEL BECERRA/AFP/Getty Images

A member of the LGBTI community holds a placard reading ’The right to marry and raise a family is for everyone’ during a demonstration in front of the Supreme Court of Justice in San Jose, on August 4, 2018 to demand the legalization of same-sex marriage.

Progress was also made earlier this year for the transgender community in Costa Rica, with the country deciding to allow trans people to change the gender markers and names on their official documents for the first time.

Journalist based in Charlotte, North Carolina, whose work has appeared in The Charlotte Observer, Creative Loafing, and more.