NEW DELHI -- It began in February with a tweet by pop star Rihanna that sparked widespread condemnation of Indian Prime Minister Narendra Modi's handling of farmer protests near the capital, souring an already troubled relationship between the government and Twitter.
Moving to contain the backlash, officials hit Twitter with 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.
On Wednesday, the company released a transparency report showing India had submitted most government information requests -- legal demands for account information -- to Twitter. It accounted for a quarter of worldwide requests in July- December last year.
It was the first time since Twitter started publishing the report in 2012 that the U.S. was displaced as the "top global requester," it added.
"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 more than 5 million users to take down content that is deemed unlawful.
If a government ministry flags content as illegal or harmful, it must be removed within 36 hours. Noncompliance could lead to criminal prosecutions. And individuals now can request that companies remove material.
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.