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.
"As a global company we've long recognized that if people around the world are to trust the technology they use, they need to have confidence that their personal information will be protected by the laws of their own country," Microsoft said.
The name and home country of the customer involved haven't been made public.
While this case was somewhat overshadowed in recent months by the battle between Apple and the US government over access to a terrorist's iPhone, it has been closely watched by the technology industry with more than two dozen companies, including Apple, Amazon.com and Cisco Systems, backing Microsoft in court.
Cisco said the ruling is important for companies charged with protecting confidential data held outside the US.
"It reinforces appropriate safeguards on the US government, and focuses law enforcement on the appropriate use of accepted international agreements," the company said.
The dispute centered on the Electronic Communications Privacy Act of 1986, a law passed before the widespread use of email, instant messages and internet-based social networks. Its aim was to protect user privacy and the law didn't envision the application of warrant provisions overseas, the appeals court said.
As more technology companies sell customers the ability to process and store their data using internet-based cloud services, information is increasingly being housed in massive data centers around the world, a situation that the relevant US law didn't anticipate when it was written three years before the invention of the World Wide Web.
As a global company we've long recognized that if people around the world are to trust the technology they use, they need to have confidence that their personal information will be protected.
"It is even more important for Congress and the Executive Branch to come together to modernize the law," Microsoft said. "We hope that today's decision will bring an impetus to faster government action."
The ruling was another setback for the government in disputes over privacy of data. In February, a federal magistrate in Brooklyn, New York, said the government lacked authority to force Apple to help it crack an iPhone that belonged to a drug dealer. The US later dropped its appeal of the ruling after it obtained a passcode to the phone.
The Justice Department and Apple also squared off over access to the iPhone used by a shooter who with his wife carried out a December attack in San Bernardino, California. Through independent means, the US subsequently gained access to the data in that device as well, ending the legal fight.
Microsoft, and it's partners and rivals, had argued that giving the US government access to data stored overseas could create a chilling effect on the rapidly growing cloud technology sector and push international clients, particularly in government and highly regulated industries, to avoid US cloud providers.
The process of requesting evidence through foreign governments can be time-consuming. American law permits them to get the data directly from US-based companies that choose to store it offshore, prosecutors said.