Spontaneous celebrations broke out across India after the country’s top court scrapped a 158-year-old colonial law that made consensual gay sex illegal.
The Indian Supreme Court reversed an earlier decision and said "Section 377" was irrational and arbitrary.
Section 377, incorporated by the British in an 1861 law, banned "Carnal intercourse against the order of nature with any man, woman or animal.”
Those violating the law could be sentenced up to 10 years in jail under its provisions.
Gay activists often complained that the police used the section to harass members of their community.
Chief Justice Dipak Misra, who headed the five-judge bench, said in his judgement: “Any consensual sexual relationship between two consenting adults - homosexuals, heterosexuals or lesbians - cannot be said to be unconstitutional.”
Summing up the euphoric response to the judgement, Meenakshi Ganguly, South Asia director for Human Rights Watch, said: “Thanks to all that fought for this, braving the worst sort of prejudice. This is a good day for human rights.”
The issue was first raised by Naaz Foundation, a non-profit organisation, which approached the Delhi High Court in 2001.
Agreeing with the petitioners, the Delhi High Court decriminalised sex between consenting adults of the same gender in 2009.
But an earlier bench of Supreme Court overturned the High Court judgment and kept Section 377 alive.
The Supreme Court again began hearing petitions against the Section 377 in July.