INDIA’s Supreme Court has removed a law from the colonial era that made gay sex punishable by up to 10 years in prison.

In a unanimous decision, five Supreme Court justices ruled the law was a weapon used to harass the gay community and resulted in discrimination.

Following the ruling, opponents of the law celebrated outside the court.

“We feel as equal citizens now,” activist Shashi Bhushan said. “What happens in our bedroom is left to us.”

The law – known as Section 377 – held that same-sex intercourse was against the order of nature.

The five petitioners who challenged the law said it was discriminatory and led to gay people living in fear of being harassed and prosecuted by police.

Arvind Datar, the attorney for the petitioners, argued in court that the penal provision was unconstitutional because it provides for the prosecution and sentencing of consenting adults.

In 2009, a New Delhi High Court declared Section 377 unconstitutional but that was overturned in a ruling by three Supreme Court justices in 2013 on the grounds that amending or repealing laws should be left to Parliament.

However, lawmakers failed to take action and in July the government told the Supreme Court to give a ruling in the case.

Over the past decade, gay people have gained a degree of acceptance in parts of deeply conservative India.

Some Bollywood films have dealt with gay issues, but being gay is still seen as shameful in much of India.

Karan Johar, a Bollywood producer and director, wrote on Twitter: “So proud today! Decriminalizing homosexuality and abolishing section 377 is a huge thumb up for humanity and equal rights! The country gets its oxygen back!”

Anna MM Vetticad, a journalist based in New Dehli, tweeted: “We are witnessing history being made. Hats off to all my #LGBT activist friends who have battled hard to get here. You have saved India from the shame of being one of the remaining countries in the world that criminalises #homosexuality – thank you for that. #Section377”.