The US Supreme Court has agreed to resolve a major privacy dispute between the country's Justice Department and Microsoft over whether prosecutors should get access to emails stored on company servers in Ireland

The justices will hear the Trump administration's appeal of a lower court's ruling last year preventing federal prosecutors from obtaining emails stored in Microsoft computer servers in Dublin in a drug trafficking investigation.

That decision by the New York-based 2nd US Court of Appeals marked a victory for privacy advocates and technology companies that increasingly offer cloud computing services in which data is stored remotely.

Microsoft, which has 100 data centres in 40 countries, was the first US company to challenge a domestic search warrant seeking data held outside the country.

There have been several similar challenges, most brought by Google.

"If US law enforcement can obtain the emails of foreigners stored outside the United States, what's to stop the government of another country from getting your emails even though they are located in the United States?" Brad Smith, Microsoft's president and chief legal officer, said in a blog post.

The Justice Department said in its appeal that the lower court ruling "gravely threatens public safety and national security" because it limits the government's ability to "ward off terrorism and similar national security threats and to investigate and prosecute crimes."

The case attracted significant attention from technology and media companies concerned that a ruling favouring the government could jeopardise the privacy of customers and make them less likely to use cloud services because of concern that data could be seized.
 

The appeals court ruled that Microsoft could not be forced to turn over emails sought in the narcotics case that were stored in Dublin.

The Microsoft customer in question had told the company he was based in Ireland when he signed up for his account.

Though Microsoft is based in Washington state, the court said the emails were beyond the reach of US domestic search warrants issued under a 1986 law called the Stored Communications Act.

The Microsoft case is the second that the justices have agreed to hear in their current term that touches upon privacy rights in the digital age and the sheer amount of data on customers that companies now hold.

The other case concerns whether police officers need a warrant to access historic location information on mobile phone users that is held by wireless carriers.

Rulings in both cases are due by the end of June.