India’s highest court has upheld a colonial-era law which criminalises gay sex, in what activists have described as a “black day” for gay rights.

The Supreme Court threw out a 2009 New Delhi High Court decision that ruled the law was unconstitutional.

The law change could see gay people jailed for up to ten years.

“Such a decision was totally unexpected from the top court. It is a black day,” said Arvind Narrain, a lawyer for the Alternative Law Forum gay rights group.

“We are very angry about this regressive decision of the court.”

Ashok Row Kavi, of the activist group Humsafar Trust, said: “This is a very sad day for us, we are back to square one in our fight for the democratic rights of the gay community.”

The Supreme Court stated that only India’s Parliament could change the law, by deleting a section of the penal code dating back to the 19th century, thus ruling that the Delhi High Court had overstepped its powers with its decision four years ago.

Section 377 of India’s penal code bans “sex against the order of nature”, which is widely interpreted to mean gay sex, and can be punished with up to 10 years in jail. The rule dates back to the days of British colonial rule in India.

“One would never expect the supreme court of India to make such a retrograde order, that is so against the trend internationally,” said rights lawyer Colin Gonsalves.

“This takes us back to the dark ages. This is a day of mourning for us in India.”

India’s law minister, Kapil Sibal, said he could not comment on the judgment and did not say if the government planned to seek an amendment to the law.

But it seems unlikely the government will risk taking a stand on the issue in the short term. General elections are coming up in May in largely socially conservative India, and the Hindu nationalist opposition is already gathering momentum.

The 2009 ruling to exempt gay sex between consenting adults from the ban was the result of a case brought by the Naz Foundation, an Indian sexual rights organisation, which fought a legal battle for almost a decade.

Hundreds of gay rights activists marched through the streets of New Delhi last month in a call to end LGBT stigmatisation and discrimination in India.

In October, over a hundred people took part in Gujarat’s first ever gay pride march in the city of Surat.