India’s supreme court has overturned a colonial-era law that has criminalised gay sex for more than 150 years.

The court announced in Delhi on Thursday morning that a ban on homosexual sex acts had been lifted in a landmark ruling, drawing cheers from the LGBTQ community and activists in the country.

An archaic law – known as Section 377 of the Indian penal code – had been imposed on Indian citizens since British rule, and it penalised intercourse “against the order of nature” with a sentence of life imprisonment.

Five LGBTQ Indians put their name to the legal petition which resulted in Thursday’s ruling, with one of those people, Ritu Dalmia, saying that the verdict gave her hope.

“I was turning into a cynical human being with very little belief in the system, but honestly this has really shown once again that, at the end, we are a functional democracy where freedom of choice, speech and rights still exist,” she said.

It has been a long and rocky road towards the legalisation of homosexual sex acts in India.

Early cases were first brought forward in 1994 and 2001, but both bounced around the higher courts for years with judges reluctant to rule on the matter.

Section 377 was then struck down by the Delhi high court in 2009 as it breached rights to life, liberty and equality that is enshrined in Indian constitution.

That, however, was overturned in 2013 by the supreme court, which ruled that because Section 377 had been imposed so infrequently it had only affected a “minuscule fraction” of the population, and therefore could not violate Indians’ constitutional rights.

“It’s an emotional day for me. It’s a mix of feelings, it’s been a long fight,” rights campaigner Rituparna Borah told CNN. “There was not enough media or society support earlier but we have it now. People will not be seen as criminals anymore.”

Danish Sheikh, a law professor at Jindal Global Law School and LGBT advocate, said that the change in legislation will “create a space of freedom where you can start expecting justice”.

He added: “After 2013, there was a lot of energetic activism in the country. The kind of outrage that was felt resonated across civil society, outside the LGBT community.

“People had started to think of themselves as legal subjects and society had started to tolerate and even accept queer persons.”

Section 377 was rarely enfored in full on LGBTQ citizens, but lawyers had argued that it contributed to a culture of repression and fear amongst India’s LGBTQ community.

As LGBTQ activists and supporters celebrate this ruling, they will now move towards gaining full equality for LGBTQ citizens.

“The next step is to start looking at issues of rights. Right now, it is just decriminalizing,” said Anjali Gopalan, founder of the Naz Foundation.

“The right that every citizen of the country should have access to and should not be taken for granted. Like the right to marry, the right to adopt, the right to inherit. Things that no one questions and that are clearly denied to a certain section of citizens.”