Jubilant crowds cheered outside a Delhi court yesterday after judges announced that gay sex was not a crime – a landmark ruling for India that spells the end for a 150-year-old law introduced by the British Raj.

Activists danced in the streets after the Delhi High Court ruled that "consensual sex amongst adults is legal which includes even gay sex and sex among the same sexes". The judgment, which technically only applies to the country's capital but which will have national implications, will boost the small but increasingly vocal gay rights movement.

"The mood inside the court was electric, it was incredible," said Gautam Bhan, who has been campaigning for the repeal of so-called "Section 377" for 10 years. "The judges quoted from a speech by Jawaharlal Nehru about India's inclusiveness. We were in tears, we were openly crying in court."

Download the new Independent Premium app Sharing the full story, not just the headlines

Another campaigner, Lesley Esteves, a journalist who was also at the court, said: "It's a historic day for queer people and everybody else in India. Finally we have been able to throw off this colonial legacy. I hope that other members of the Commonwealth are also able to do this."

Campaigners who had launched a legal challenge to the law said it was anti-constitutional because it acted as an impediment to fighting Aids as many gay people declined to be identified because of fear of harassment or discrimination. "We have finally entered the 21st century," said Anjali Gopalan, leader of Naz Foundation, a leading health and gay rights lobby which had brought the lawsuit.

Despite the court's decision, Section 377 can only be repealed by parliament. In recent days the government has indicated that it may be prepared to review the law and is considering getting rid of it.