Unless you are gay, and have lived in one of the 70 or so countries where homosexuality is illegal, it is hard to imagine what it would feel like if embarking on any sexual relationship entailed committing a crime. In many places heterosexual people too can get in trouble for having sex outside marriage. But the burden of legislation outlawing sex has long weighed most heavily on gay people for whom, where such prohibitions exist, there is often no legal means of living as themselves.

The pressure can be unbearable even when relationships are undetected, or are never begun for fear of the cost. So last week’s judgment by the Indian supreme court is a reason to rejoice. It not only decriminalised gay sex, but ruled that gay citizens enjoy all the protections of the constitution. “History owes an apology to members of the community for the delay in ensuring their rights,” said judge Indu Malhotra. The decision follows recent decisions in favour of gay rights in Costa Rica, Bulgaria, Belize and Trinidad and Tobago. But India’s size, influence and history means the significance of this move should not be underestimated.

Western campaigns for gay liberation were part of a broader liberal agenda associated with the baby boomers, and ran in parallel to the other struggles of the 1960s and 1970s: for civil rights in the US, for women’s rights, against censorship. In India, as in many other parts of the world, the dynamics are different. Public health concerns connected with the HIV/Aids crisis played an important part in initiating the challenge to the status quo. The first petition against section 377 of the Indian penal code – which was introduced by the British – dates from the 1980s.

It’s widely assumed in the west that when it comes to individual freedoms we are the leaders. It’s true that gay people in the UK have never been subjected to the brutal punishments meted out by the authorities in Saudi Arabia, or Malaysia, where two women were publicly caned last week for attempting to have sex. But it is salutary to be reminded that of the 70 or so countries where homosexuality remains illegal, more than 40 were once under British rule. While UK laws are now among the most liberal in the world, section 28 – banning the “promotion” of homosexuality – was not repealed until 2003.

In a small number of countries, including Tanzania, persecution has recently been on the rise rather than the reverse. Conservative religious forces as well as machismo can reinforce prejudices, with LGBT issues presented as a western form of deviance. This is why the decision of Indian campaigners to give a human face to the issue was so important. By coming out so publicly and so bravely, the petitioners – including a dancer, a journalist, a chef and an engineer – showed that they were part of Indian society.

Securing legal protections against discrimination is the next step. But in India the greatest hurdle, that of decriminalisation, has been overcome. Activists elsewhere will take heart.