India's Supreme Court on Thursday struck down a colonial-era ban on gay sex at the centre of years of legal battles.
"The law had become a weapon for harassment for the LGBT community," Chief Justice Dipak Misra said as he announced the landmark verdict.
Section 377 of the Indian penal code, enacted by British rulers in 1861, banned "carnal intercourse against the order of nature".
Activists had been fighting the ban since the 1990s, suffering several court reverses before Thursday's verdict which sparked celebrations among lesbian, gay, bisexual and transgender groups across the vast South Asian nation.
Members of the LGBT community hugged each other and cried as news of the verdict spread.
"I am speechless! It's taken a long time to come but finally I can say I am free and I have equal rights as others," said Rama Vij, a college student who wore a rainbow scarf.
Gay sex has long been taboo in conservative India -- particularly in rural areas where homophobia is widespread.
The Delhi High Court decriminalised gay sex in 2009, but the Supreme Court reinstated legal sanctions in 2014 after a successful appeal by religious groups.
According to official data, 2,187 cases under Section 377 were registered in 2016 under the category of "unnatural offences".
Seven people were convicted and 16 acquitted.