A deafening uproar has greeted the top Indian court's verdict making gay sex illegal, with activists, media and social networks condemning the decision and saying that the clock had been turned back to colonial times.

The Supreme Court judgment reversed an earlier ruling of the Delhi high court which decriminalised gay sex in 2009.

The verdict on Wednesday upheld the validity of Section 377 of the Indian penal code which prescribes life in jail for those indulging in "carnal sex against the order of nature".

The latest judgment stunned even the federal government. Several ministers openly criticised the verdict and the federal home minister Sushil Kumar Shinde said they would try bringing in a law that would negate the court ruling.

The government had not appealed against the earlier 2009 judgment as it favoured decriminalisation of gay sex, but had not bothered to incorporate that into its laws.

Leading newspapers like The Hindu and Times of India criticised the judgment as regressive and against personal liberty and equality.

The legal community including top lawyers like Soli Sorabjee, Harish Salve and Indira Jaising said the verdict smacked of a medieval mindset. Salve suggested that the judgment be challenged while Sorabjee was reported as saying "you can't blame people for having a different orientation".

Reports quoted Salve as saying, "a battle lost is not a war lost". The issue has to be raised repeatedly until is satisfactorily resolved, he said.

Popular author Vikram Seth was quoted by the media as saying, "it was a great day for prejudice and inhumanity and a bad day for law and love."

Reports quoting Seth's interview on television said, "All I hope is that this judgment is cured, revised or overruled by a larger bench so that this stain is washed away."

Across the various cities of Mumbai, Delhi, Kolkata, Chennai and Bangalore activists spontaneously took to the streets in protest against the verdict with many saying "sexual orientation was a private matter and was a choice of individuals".

Activists have reportedly threatened to continue the protests until the judgment is neutralised either by a court review or through a law in parliament.