Germany’s data privacy watchdog banned Facebook on Tuesday from collecting and storing data from the country’s WhatsApp users. Facebook was also ordered to delete all the data it has collected from WhatsApp so far.

The Hamburg Commissioner for Data Protection and Freedom of Information said that the California-based technology giant had no legal basis for using information collected from WhatsApp customers. Facebook took over the instant messaging service in 2014. After the acquisition, the app’s co-founder, Jan Koum, told users that their privacy will not be compromised.

In August, Facebook announced that WhatsApp will share some user information with the tech giant including the user’s phone number to deliver more targeted advertising and allow businesses to contact customers directly.

Johannes Caspar, the Hamburg Commissioner for Data Protection and Freedom of Information, said that this order protected the 35 million WhatsApp users in Germany, adding that it is up to the user to decide whether they want to connect their WhatsApp account with Facebook. “Facebook has to ask for their permission in advance,” Caspar said in a statement.

"... There are many millions of people whose contact details were uploaded to WhatsApp from the user’s address books, although they might not even have a connection to Facebook or WhatsApp,” he said. “According to Facebook, this gigantic amount of data has not yet been collected. Facebook’s answer, that this has merely not been done for the time being, is cause for concern that the gravity of the data protection breach will have much a more severe impact.”

Facebook has repeatedly clashed with German authorities over data privacy rules applicable in the European Union. The company argued that it is only bound by data protection laws in Ireland as its European operations are based there.

In an email to Bloomberg, Facebook said that it complies with the European Union’s laws on data protection and is “open to working with” German officials to “resolve any concerns” and address questions on its data-sharing project.