Top government sources told NDTV they would "go by the court" and not push for criminalising gay sex, commenting that decriminalisation is a global trend.

Gay rights activists across the country exulted over the Supreme Court ruling that said "societal morality changes from age to age. Law copes with life and accordingly change takes place".

The "section of people who exercise their choice should never remain in a state of fear", said the judges.

The Supreme Court also noted that "choice can't be allowed to cross the boundaries of law but the confines of law can't trample or curtail the inherent right embedded in an individual under Article 21, the right to life and liberty."

Under the law, those convicted under Section 377 of the Indian Penal Code face up to 10 years in jail.

The top court acted on the petition by Aman Nath, the owner of Neemrana hotels, Navtej Johar, a classical dancer, celebrity chef Ritu Dalmia, former editor Sunil Mehra and restauranteur Ayesha Kapur.

In 2013, the Supreme Court had cancelled a Delhi high court order that had decriminalized homosexuality by overturning the outdated law and said it was the job of parliament to decide on scrapping laws.

That decision needs to be reconsidered because of constitutional issues, said the Supreme Court.

In 2009, the Delhi High Court had described Section 377 as a violation of the fundamental rights guaranteed by the constitution. It had responded to a petition by Naz Foundation, which has fought for almost a decade for gay rights.