The Indian government must take swift action to challenge a Supreme Court decision banning gay sex, its law minister has said.

Kapil Sibal said he was for decriminalising homosexuality, hinting that the government could seek a judicial review of Wednesday's Supreme Court decision or that Parliament could enact a new law.

"We need to take quick and firm action," he told reporters, noting that millions of people in India do not want homosexuality to be a criminal offence.

The Supreme Court ruled that only MPs could change a colonial-era law that bans same-sex relations and makes them punishable by up to a decade in prison.

The ruling dealt a blow to gay activists who have fought for years for the chance to live openly in India's deeply conservative society.

Sonia Gandhi, chief of the governing Congress party, also lent support to the activists and expressed her disappointment with the court order.

"I hope Parliament will address this issue and uphold the constitutional guarantee of life and liberty to all citizens of India, including those directly affected by this judgment," she said in a statement.

Mrs Gandhi's son and the party's vice president, Rahul Gandhi, said such personal matters should be left to individuals. "This country is known for its freedom, freedom of expression," he told reporters.

India's lesbian, gay, bisexual and transgender community reacted to the decision with defiance.

"We cannot be forced back into the closet," said Gautam Bhan, an activist who had petitioned the court. "We are not backing off from our fight against discrimination."

Lawyers and supporters of gays, lesbians and transsexuals vowed to continue pressing for the removal of the law, which they say encourages discrimination, even if it is rarely invoked by prosecutors.

The law, dating back to the 1860s, when Britain ruled India, states that "whoever voluntarily has carnal intercourse against the order of nature with any man, woman or animal" can be punished by up to 10 years in prison.

The 2009 New Delhi High Court ruling, which said the law violated fundamental human rights, infuriated conservatives and religious groups who say homosexuality represents a threat to traditional Indian culture.

In a rare alliance, the groups - including the All India Muslim Law Board, Christian groups and Hindu spiritual leaders - argued that gay sex is unnatural and that India should maintain the law.

Activists have long argued that the law encourages discrimination and leaves gays, lesbians and bisexuals vulnerable to police harassment or demands for bribes.

Acceptance is slowly growing in India, though, particularly in big cities such as New Delhi and Mumbai. In the last few years, activists have staged large gay pride parades featuring rainbow-coloured flags and banners, joyful songs and dancing through the streets.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.