Microsoft's epic court battle with DOJ is coming to an end

supreme court building

Microsoft fought a court battle with the Department of Justice all the way to the Supreme Court — but the saga could soon be coming to an end.

President Donald Trump just signed a new law that makes the legal fight obsolete.

The Cloud Act, which is tucked into the spending bill that Trump signed Friday, addresses the question at the heart of the issue: Can law enforcement officials force US companies to hand over data that's stored on servers in foreign countries?

The Cloud Act establishes a legal pathway for the US to form agreements with other nations that make it easier for law enforcement to collect data stored on foreign soil.

The measure is supported by major players in the tech industry, but has been criticized by privacy and civil liberties advocates.

Related: Microsoft argues data privacy case is one for Congress to decide

Microsoft (MSFT), for one, is cheering. The Cloud Act provides the legal clarity the company sought all along. Under current laws, Microsoft has argued, sharing data stored abroad could violate international treaties and policies.

The company's president and chief legal officer, Brad Smith, said in a blog post that the Cloud Act is a "good compromise" that addresses law enforcement needs while also ensuring "appropriate protections for privacy and human rights."

Microsoft's epic court battle started in 2013 when it refused to hand over emails stored on a server in Ireland to US officials who were investigating drug trafficking.

The case worked its way up to the Supreme Court, where oral arguments were heard last month.

From the bench, justices urged Congress to address the matter.

Related: IBM and Microsoft battle over top workplace diversity exec

Republican Senator Orrin Hatch has led the charge to get a new law on the books, and lawmakers on both sides of the aisle support his Cloud Act.

"The bill sets forth strict privacy, human rights, and rule of law standards that countries that enter into such agreements must meet," Hatch said in a blog post. "It also contains provisions to ensure that consumers are protected by their nation's own laws."

Advocacy groups including Amnesty International and Human Rights Watch, however, are not convinced.

They oppose the Cloud Act, arguing the law would not ensure the US sufficiently vets requests from other countries. They fear the US could wind up handing over data to another country that will be used in bad faith, a post penned by representatives for the ACLU and Amnesty International argues.

CNNMoney Sponsors