WhatsApp has blocked the accounts of 2 million users on its app as part of an effort to prevent spam on its messaging platform.

The company revealed the closure of the accounts in its first compliance report that was published under India’s new information technology regulations that took effect in May.

Under the new rule, social media companies like WhatsApp need to publish compliance reports each month detailing the number of complaints they receive from Indian users and the actions they took to correct the issues.

According to the report, WhatsApp, which is owned by Facebook (FB), said that more than 95% of the 2 million accounts that it blocked from May 15 to June 15 were banned because of spam, CNN reported. It also said in its report that they blocked the accounts “due to the unauthorized use of automated or bulk messaging,” according to the BBC.

WhatsApp halted the accounts to prevent harmful or unwanted messages from being sent in large volumes, which it said is a “top focus” for the company, the BBC said. The messaging app used advanced machine learning technology to identify Indian accounts with a +91 phone number, according to BBC.

In a statement on Thursday, obtained by CNN, WhatsApp said, “These numbers have increased significantly since 2019 because our systems have increased in sophistication. Keep in mind, we ban the vast majority of these accounts proactively, without relying on any user reports.”

The statement continued by saying that the company blocks 8 million accounts globally on average each month.

In India, the app has over 400 million users and 2 billion users worldwide, CNN reported. India is the biggest market of the social media platform for WhatsApp.

WhatsApp has sued the Indian government over the requirement to provide a compliance report each month, saying it is concerned that it could end its guarantee of user privacy by requiring it to keep track of every message sent on the platform.

However, the Indian government claims the rules are designed to prevent abuse among users and the dissemination of misinformation.

In 2018, fake messages were sent to tens of thousands of WhatsApp users, inciting mob violence in India, which lead to a series of deaths in the country.

Shares of Facebook were trading at $344.57 as of premarket hours on Friday, up 11 cents, or 0.03%.

The teenagers were arrested for sharing pornographic images via the WhatsApp messaging service
Whatsapp logo. AFP / YASUYOSHI CHIBA