Facebook has emerged victorious in a battle over data privacy after an adviser to the European Union’s top court announced in a landmark case that the transfer of data outside the bloc is legal.

The non-binding opinion on Thursday from the European Court of Justice’s adviser comes after a long-running case against the social media company sought to clamp down on the use of tools by businesses to transfer the data of EU citizens to other parts of the world.

Max Schrems, an Austrian lawyer and privacy advocate, brought the case against Facebook after he contested that its current protocol for transferring data did not offer sufficient data protection, violating the privacy of EU users.

Facebook and other companies such as banks and multinational conglomerates use contractual clauses to transfer personal data abroad, and rely on such clauses for key parts of their businesses such as cloud computing, outsourced services and payments.

But in a blow to privacy advocates, Henrik Saugmandsgaard Øe, advocate general to the European Court of Justice, sided with Facebook and other companies by deeming their transfer of data abroad electronically as legal.

“Standard contractual clauses for the transfer of personal data to processors established in third countries is valid,” he said.