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 Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

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.

VICTORY! Thank you so much for everyone’s messages of support! WE DID IT! We found an EQUAL PLACE!!!! ️‍️ — Jason Jones (@trinijayjay) April 12, 2018

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.

Activist Jason Jones sings the national anthem before hwading to the High Court to hear the ruling on his matter challenging #buggery laws in Trinidad and Tobago pic.twitter.com/apCCLvt0pt — LoopNewsTT (@LoopNewsTT) April 12, 2018

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.”

A religious protestor stands at the entrance to the Hall of Justice against the removal of #buggery laws pic.twitter.com/d1WLroH8kW — LoopNewsTT (@LoopNewsTT) April 12, 2018

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