Microsoft is suing the US government in a bid to tell its users when their data has secretly been accessed by law enforcement agencies.

The lawsuit filed by the company says its customers shouldn't be kept "in the dark" when officials seek to access emails or other private information stored when it has "reason to believe" disclosure to the person may hinder an investigation.

"Microsoft brings this 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," the company said.

The US Electronic Communications Privacy Act, written in 1986, under Section 2705(b), prevents companies from telling customers about "authorised wiretapping" when it may damage an investigation. Microsoft said that 5,624 requests for customer data were made by US government in the last 18 months – nearly half of these came with orders saying the information should be secret.

With more and more people using cloud services, Microsoft argued that the government was seeking access to their "most private and sensitive information".

The implication of using cloud services is that nobody would know when their data was accessed. "People do not give up their rights when they move their private information from physical storage to the cloud," the lawsuit says.

The company, represented by lawyer Davis Wright Tremaine, said that orders issued under Section 2705(b) violate the Fourth Amendment. This gives citizens the constitutional right to be protected from unreasonable searchers, seizes and warrants. As a result, Microsoft has argued, this section of the Act should be ruled unconstitutional.

The dispute is the second high profile lawsuit between a technology company and the US government in as many months. It follows Apple's iPhone unlocking argument with the FBI/Department of Justice; but also differs by being initiated by the company rather than the government.

Having uncovered an undisclosed security flaw to unlock the phone the FBI dropped its case. But the two will face-off at a Congressional hearing debating encryption next week.

As in the Apple case, other technology companies have come out in support of Microsoft. Yahoo told the Wall Street Journal that it was "supportive of Microsoft’s suit" as it encourages more transparency around government demands.

Cloud storage company Box also told the newspaper that it "fully support[s]" Microsoft's position.