A top cabinet minister accused India's Supreme Court of dragging the country back to the 19th century by reinstating a ban on gay sex and called for a swift reversal of the ruling.

Finance Minister P. Chidambaram, who doubles up as the government's chief spokesman, said gay rights legislation could be drawn up following Wednesday's verdict but warned that such a move would be time-consuming.

"What we have done is go back in time to 1860 and I'm terribly disappointed," Chidambaram told the NDTV network.

"We must explore ways and means in which this judgement can be reversed very quickly. Legislation is one way to reverse it but that may take time.

"(While) not giving up that option of legislation, we must explore other ways and I am willing to sit with my colleagues to find out if there are other ways in which this judgement might be reversed."

Gay sex had been effectively legalised in 2009 when the Delhi High Court ruled that a section of the penal code prohibiting "carnal intercourse against the order of nature" was an infringement of fundamental rights.

But in a shock judgement on Wednesday, a panel of two Supreme Court judges ruled that the High Court had overstepped its authority and that a law passed in 1860 during British colonial rule was still valid.

The ruling was met with dismay by gay rights activists who called it a "Black Day" for India while newspapers said the judgement was an embarrassing throwback.

"It brings a discriminatory law that was created over 150 years ago by our colonial masters. It deals a body blow to the very idea of individual choice," said The Times of India in a front-page editorial.

But the same paper also said politicians had only themselves to blame for leaving such an issue in the hands of the courts rather than address it through legislation.

"An amendment of 377 (the section of the code in question) is something parliament should have done on its own a long time ago," it said.

The prospects of any gay rights laws being passed ahead of elections due next May look remote as the ruling Congress party and the opposition have been at loggerheads for months.

AFP