New Russian legislation requires social media sites, messenger services and search engines to store the data of Russians on servers within the country

Moscow has warned Twitter that it must store Russian users' personal data in Russia, under a new law, the national communications watchdog told AFP on Wednesday.

Legislation that came into force on September 1 requires both Russian and foreign sites, messenger services and search engines to store the data held on Russian users on servers located inside the country.

The controversial law was adopted amid Internet users' growing concerns about the storage of their data, but also as Russia has moved to tighten security on social media and online news sites that are crucial outlets for the political opposition.

Non-compliance could lead Russia's communications watchdog Roskomnadzor to block the sites and services.

Roskomnadzor spokesman Vadim Ampelonsky confirmed to AFP that Russia had changed its initial position on US-based Twitter, which it had previously said did not fall under the law.

Twitter must comply because it now asks users to supply their , Ampelonsky said, confirming earlier comments by the head of Roskomnadzor Alexander Zharov to Russian media.

Roskomnadzor has sent both Twitter and Facebook official messages asking whether they intend to comply with the law but neither has replied, Ampelonsky said.

"A few months ago, Twitter changed its terms of use [...] and now collects personal data, according to us," Roskomnadzor head Zharov told Russian media on Tuesday.

In July, the watchdog had said the new legislation would not apply to Twitter because the service did not store ' data.

The deputy head of the , Maxim Ksenzov, in May threatened to block Twitter in Russia, only to be reprimanded by Prime Minister Dmitry Medvedev, an avid social media user, who recommended officials "switch on" their brains.

Twitter declined to comment when contacted by AFP on Wednesday.