In their well-argued ruling, two judges of the court said the portion of the law in question, Section 66A, was “cast so widely that virtually any opinion on any subject would be covered by it.” The Indian Constitution gives citizens a right to free speech but allows the government to impose “reasonable restrictions” in the interest of security, decency and morality and other values. The judges said Section 66A was not reasonable because it was arbitrary and excessive.

The court also raised the standard for when Internet companies like Google and Facebook are required to take down offensive content on their websites. Internet firms should only have to take down information if ordered to do so by courts or government officials. Previously, companies could be held liable if they failed to take down content when asked to do so by private individuals and groups.

The ruling was not as strong as it could have been. The court upheld another section of the technology law that allows government officials, on their own authority, to block websites if they decide that doing so is in the interest of national security, friendly relations with other countries or public order. It would have been better if the judges had required the government to block content only after obtaining a court order.

The court’s decision will remove only one of the many tools Indian officials and right-wing activists, who often goad the government to act by filing legal complaints, have used to squelch speech that they do not like. For example, the government of Prime Minister Narendra Modi recently used several laws, including Section 66A, to obtain a court order temporarily banning a BBC documentary about the rape of a young woman in New Delhi in late 2012.

In another potentially disturbing move, the government intends to create a new university that was modeled after a Chinese institution that trains journalists for media companies that publish and broadcast Communist Party propaganda, according to an Indian newspaper report from earlier this month.