Trinidad and Tobago is set to decriminalize homosexuality after a high court judge ruled Thursday that the Caribbean nation’s colonial-era law banning gay sex is unconstitutional.

“The court declares that sections 13 and 16 of the [Sexual Offenses Act] are unconstitutional, illegal, null, void, invalid and of no effect to the extent that these laws criminalise any acts constituting consensual sexual conduct between adults,” Justice Devindra Rampersad wrote in his ruling.

Section 13 of the country’s Sexual Offenses Act states that a person who engages in “buggery” — another term for anal sex — could face up to 25 years in prison. Section 16 states that an individual who “commits an act of serious indecency” — defined as an act “other than sexual intercourse” involving the “use of the genital organ for the purpose of arousing or gratifying sexual desire” —could face 5 years in prison.

LGBTQ activist Jason Jones filed a lawsuit in February 2017 to overturn Trinidad and Tobago's gay sex laws. Sean Drakes / LatinContent - Getty Images file

The lawsuit was filed in February 2017 by LGBTQ activist Jason Jones against the country’s attorney general. Jones, a native of Trinidad and Tobago and the United Kingdom, claimed Sections 13 and 16 of the Sexual Offenses Act violated his right to privacy and freedom of expression.

Following Judge Rampersad’s ruling, Jones took to Twitter to celebrate his victory and thank his supporters.

Kenita Placide, a Caribbean adviser for LGBTQ human rights group OutRight Action International, which has been following the case, applauded Judge Rampersad’s decision in a statement sent to NBC News.

“The judge came down on the right side of history in this case by striking down the buggery law and ruling it as unconstitutional,” Placide stated. “The activism and advocacy will continue in Trinidad and Tobago and across the Caribbean until equality for LGBTIQ people is guaranteed.”

Placide said she hopes the ruling in Trinidad and Tobago, along with a similar 2016 ruling in Belize, will carry the momentum to other parts of the region with anti-LGBTQ rules on the books.

Not everyone in the country of 1.3 million was rooting for the removal of laws banning gay sex. According to OutRight Action International, opposition from conservative religious groups was strong.

A spokesperson for Christian group T&T Cause warned that the removal of the “buggery laws” would be a “slippery slope to same-sex marriage,” which she called “a cancer.”

The decision by Judge Rampersad sets in motion the decriminalization of homosexuality in Trinidad and Tobago, but a final judgment regarding exactly what will happen to Sections 13 and 16 of the Sexual Offenses Act will be made in July.

More than 70 nations around the world currently criminalize homosexuality, and in several countries the punishment for same-sex sexual activity could be death, according to a 2017 report by the International Lesbian, Gay, Bisexual, Transgender and Intersex Association (ILGA).

FOLLOW NBC OUT ON TWITTER, FACEBOOK AND INSTAGRAM