The Supreme Court on Wednesday overturned the 2009 Delhi High Court ruling that legalises homosexual sex and has now reinstated it as a criminal offence.
The decision comes as a major setback for the marginalised section in the country which was hoping for the apex court to retain the 2009 ruling.
The new ruling on Wednesday declared that the 2009 ruling was "constitutionally unsustainable". Four year ago, the Delhi High Court had decriminalised homosexuality after overlooking Section 377 of the Indian Penal Code and had ruled that sex between two consenting homosexual adults should not be considered illegal.
The landmark judgment by the Delhi High Court was challenged by political, social and religious groups who wanted to sustain the colonial-era law.
Section 377 of the Indian Penal Code defined homosexual acts as "carnal intercourse against the order of nature" and named them illegal or immoral.
The Delhi High Court had described the law as "discriminatory" and said there is no legal basis on which sex between two consenting adults could be considered illegal, irrespective of whether they were gay or straight.
The July 2009 verdict was unanimously and widely welcomed by India's gay community.
Observing that Section 377 is a valid constitutional provision, the apex court said on Wednesday that appropriate and select changes in the section can be made through legislation and that the judiciary had nothing to do with it.
"This is a black day for the community, the judgment is a huge disappointment. We will take the issue forward, we will fight back," human rights lawyer Arvind Narrain told IBN Live.
Same-sex relationships had been considered illegal and immoral in India since 1890s when a British colonial law termed the act as "against the order of nature".