NEW DELHI, JULY 15

It began in February with a tweet by pop star Rihanna that sparked widespread condemnation of Indian Prime Minister Narendra Modi's handling of massive farmer protests near the capital, souring an already troubled relationship between the government and Twitter.

Moving to contain the backlash, officials hit Twitter with multiple injunctions to block hundreds of tweets critical of the government. Twitter complied with some and resisted others.

Relations between Twitter and Modi's government have gone downhill ever since.

At the heart of the standoff is a sweeping internet law that puts digital platforms like Twitter and Facebook under direct government oversight. Officials say the rules are needed to quell misinformation and hate speech and to give users more power to flag objectionable content.

Critics of the law worry it may lead to outright censorship in a country where digital freedoms have been shrinking since Modi took office in 2014.

Police have raided Twitter's offices and have accused its India chief, Manish Maheshwari, of spreading "communal hatred" and "hurting the sentiments of Indians." Last week, Maheshwari refused to submit to questioning unless police promised not to arrest him.

"India's plans for the internet appear to be like that of a closed ecosystem like China," said Raheel Khursheed, co-founder of Laminar Global and Twitter India's former head of Politics, Policy and Government. "Twitter's case is the basis of a touchstone on how the future of the internet will be shaped in India."

Tech companies are facing similar challenges in many countries. China has been aggressively tightening controls on access to its 1.4 billion-strong market, which is already largely sequestered by the Communist Party's Great Firewall and by U.S. trade and technology sanctions.

India is another heavyweight, with 900 million users expected by 2025.

"Any internet company knows that India is probably the biggest market in terms of scale. Because of this, the option of leaving India is like the button they'd press if they had no options left," said tech analyst Jayanth Kolla.

The new rules, in the works for years and announced in February, apply to social media companies, streaming platforms and digital news publishers. They make it easier for the government to order social media platforms with over 5 million users to take down content that is deemed unlawful. Individuals now can request that companies remove material. If a government ministry flags content as illegal or harmful it must be removed within 36 hours. Noncompliance could lead to criminal prosecutions.

Tech companies also must assign staff to answer complaints from users, respond to government requests and ensure overall compliance with the rules.

Twitter missed a three-month deadline in May, drawing a strong rebuke from the Delhi High Court. Last week, after months of haggling with the government, it appointed all three officers as required.

"Twitter continues to make every effort to comply with the new IT Rules 2021. We have kept the Government of India apprised of the progress at every step of the process," the company said in a statement to the Associated Press.

Apar Gupta, executive director of the Internet Freedom Foundation, says he worries the rules will lead to numerous cases against internet platforms and deter people from using them freely, leading to self-censorship. Many other critics say Modi's Hindu nationalist government is imposing what they call a climate of "digital authoritarianism."

"If it becomes easier for user content to be taken down, it will amount to the chilling of speech online," Gupta said.

The government insists the rules will benefit and empower Indians.

"Social media users can criticize Narendra Modi, they can criticize government policy, and ask questions. I must put it on the record straight away . . . But a private company sitting in America should refrain from lecturing us on democracy" when it denies its users the right to redress, the ex-IT minister, Ravi Shankar Prasad, told the newspaper The Hindu last month.

Despite the antagonisms between Modi and Twitter, he has been an enthusiastic user of the platform in building popular support for his Bharatiya Janata Party. His government has also worked closely with the social media giant to allow Indians to use Twitter to seek help from government ministries, particularly during health emergencies. Bharatiya Janata Party's social media team has meanwhile been accused of initiating online attacks against critics of Modi.

Still, earlier internet restrictions had already prompted the Washington-based Freedom House to list India, the world's most populous democracy, as "partly free" instead of "free" in its annual analysis.

The law announced in February requires tech companies to aid police investigations and help identify people who post "mischievous information." That means messages must be traceable, and experts say this it could mean end-to-end encryption would not be allowed in India.

Facebook's WhatsApp, which has more than 500 million users in India, has sued the government, saying breaking encryption, which continues for now, would "severely undermine the privacy of billions of people who communicate digitally."

Officials say they only want to trace messages that incite violence or threatening national security. WhatsApp says it can't selectively do that.

"It is like you are renting out an apartment to someone but want to look into it whenever you want. Who would want to live in a house like that?" said Khursheed of Laminar Global.

The backlash over online freedom of expression, privacy and security concerns comes amid a global push for more data transparency and localization, said Kolla, the tech expert.

Germany requires social media companies to devote local staff and data storage to curbing hate speech. Countries like Vietnam and Pakistan are drafting legislation similar to India's. In Turkey, social media companies complied with a broad mandate for removing content only after they were fined and faced threats to their ad revenues.

Instead of leaving, some companies are fighting the new rules in the courts, where at least 13 legal challenges have been filed by news publishers, media associations and individuals. But such cases can stretch for months or even years.

Mishi Choudhary, a technology lawyer and founder of India's Software Freedom Law Center, says that under the rules, social media platforms might lose their safe harbor protection, which shields them from legal liability over user-generated content. Courts have to decide that on a case-by-case basis, she said. And their legal costs would inevitably soar.

"You know how it is in India. The process is the punishment," Choudhary said. "And until we get to a place where the courts will actually come and tell us what the legal position is and determine those legal positions, it is open season for tech backlash."