Microsoft on Thursday sued the US government, arguing that secret warrants to search people's email violate constitutional rights of Americans.
The US tech giant brought the case "because its customers have a right to know when the government obtains a warrant to read their emails, and because Microsoft has a right to tell them," said the court filing in federal court in Seattle, near the company headquarters in Washington state.
The lawsuit said that a requirement to keep silent on warrants for data -- based on a presumption that tipping people off might hamper investigations -- violates constitutional protection of free speech and safeguards against unreasonable searches.
In the past 18 months, federal courts have issued nearly 2,600 secrecy orders gagging Microsoft from saying anything about warrants and other legal actions targeting customers' data, according to the filing.
"We believe that with rare exceptions consumers and businesses have a right to know when the government accesses their emails or records," Microsoft chief legal officer Brad Smith said in a blog post.
"Yet it's becoming routine for the US government to issue orders that require email providers to keep these types of legal demands secret. We believe that this goes too far and we are asking the courts to address the situation."
Internet giants have complained that these types of secret search warrants erode trust in US technology companies while trampling on the rights of citizens and businesses.
The situation has become more urgent as computing and data storage services shift from software packages loaded onto individual computers to servers running in the Internet cloud.
"Today, individuals increasingly keep their emails and documents on remote servers in data centers -- in short, in the cloud," Smith said.
"But the transition to the cloud does not alter people's expectations of privacy and should not alter the fundamental constitutional requirement that the government must -- with few exceptions -- give notice when it searches and seizes private information or communications."
Controversy over spying, security and privacy on the Internet has been heating during the past decade, boiling over after former US intelligence contractor Edward Snowden revealed evidence of wide-scale online spying.
While rights groups have filed suits to stop the government from covert snooping on the Internet, Microsoft is on firmer legal footing as a cloud service provider being hit with court orders, according to Electronic Frontier Foundation staff attorney Lee Tien.
"Microsoft has a view of what is happening that the EFF does not," Tien told AFP.
"This is important for advocacy in general and for litigation, because facts put the meat on the bone for what is going on -- to explain to the court the scope of the problem."
Legally, Microsoft took aim at the Electronic Communications Privacy Act -- typically used by police investigating crime, and not the one used to back National Security Letters that order tech companies to remain mum about search warrants in the name of fighting terrorism.
The constitutional arguments against gagged warrant requests in both cases are very similar, and a Microsoft victory in court could echo in a challenge to national security letters, the attorney reasoned.
"From a legal perspective, they are similar kinds of cases," Tien said.
Microsoft's legal challenge follows a high-stakes battle over FBI demands for access to an iPhone used by a gunman in a December 2 rampage that left 14 dead in San Bernardino, California.
The government wanted Apple to create a new tool to bypass the smartphone's security systems, but the company refused.
Although that showdown ended with investigators saying they had extracted the data from the iPhone on their own, the Justice Department reignited the battle last week in a separate case involving someone accused of trafficking in methamphetamines.
In a filing in New York, the Justice Department told a federal judge it wants Apple to extract pictures, text messages and other digital data from an iPhone used by the defendant in that case.
The US government has based its demands in both the San Bernardino case and the New York drug trafficking case on the All Writs Act -- a 1789 law that gives wide latitude to help law enforcement.
Earlier this year, a lower court judge in New York sided with Apple, saying law enforcement lacked the authority to compel the company to comply.
Apple argues that the government is overstepping its authority and is intent on establishing a troubling legal precedent, contending that lawmakers should decide the degree to which third parties can be compelled to work for the government.