Microsoft won’t be forced to turn over emails stored in Ireland to the U.S. government for a drug investigation, an appeals court said in a decision that may affect data security throughout the U.S. technology industry.

The ruling on Thursday overturned a 2014 decision ordering Microsoft to hand over messages of a suspected drug trafficker.

The company argued that would create a “global free-for-all” with foreign countries forcing companies to turn over evidence stored in the United States. The government said a ruling in favor of Micro- soft would create legal loophole to be exploited by fraudsters, hackers and drug traffickers.

The law doesn’t “authorize courts to issue and enforce against U.S.-based service providers warrants for the seizure of customer e-mail content that is stored exclusively on foreign servers,” U.S. Circuit Judge Susan Carney wrote for the majority of the New York appeals court.

The government is considering its options, Peter Carr, a spokesman for the U.S. Department of Justice, said in a statement.

Microsoft said the ruling is a win for the protection of people’s privacy rights under their own laws, rather than the reach of foreign governments.