The companies argue that publishing aggregated statistics about the scope of the surveillance would not threaten national security and that they have a First Amendment right to discuss the information.
Google and Microsoft negotiated with government lawyers for several weeks over how much they should be allowed to disclose. But those negotiations have collapsed and both companies are now preparing for a legal showdown before the secretive Foreign Intelligence Surveillance Court, which handles national security surveillance issues.
The companies and the Justice Department agreed to a ten-day extension on Friday, which will give the companies time to refine their legal filings, according to people familiar with the case. After that period, the companies are expected to move forward with litigation.
Brad Smith, Microsoft's general counsel, said the company is prepared to fight for its constitutional rights in court.
"With the failure of our recent negotiations, we will move forward with litigation in the hope that the courts will uphold our right to speak more freely," Smith wrote in a blog post. "And with a growing discussion on Capitol Hill, we hope Congress will continue to press for the right of technology companies to disclose relevant information in an appropriate way."
Google declined to comment on its legal strategy, but the company is not expected to back down.
Microsoft and Google first asked to reveal more information after documents leaked by Edward Snowden indicated that they, along with other major Internet companies, participate in a vast surveillance program called PRISM.
The companies vociferously denied giving the NSA direct access to their servers but acknowledged that they are required to turn over data in response to specific legal requests.
The stakes are high for Internet companies like Google and Microsoft that depend on users trusting them with their most sensitive personal information. If users worry that the information they share isn't safe from snooping government agents, they are less likely to use the online services, meaning less advertising revenue for the companies.
Both Google and Microsoft already publish regular reports on their compliance with requests from police and other officials for user information. But the U.S. government has limited the companies' ability to disclose information about requests related to national security.
Director of National Intelligence James Clapper announced on Thursday that the government will soon publish its own reports with surveillance statistics. He said the reports will include data on the total number of secret court orders to communications providers and the number of people targeted in those orders.
When asked about the legal conflict with Google and Microsoft, a Justice Department spokesman pointed to Clapper's statement on the new disclosures.
But both companies said the government's announcement does not go far enough.
In a statement, Google said Clapper's decision to publish the annual reports is a "step in the direction" but that "there is still too much secrecy around these requests and that more openness is needed."
"The Government’s decision represents a good start," Microsoft's Smith wrote in his blog post. "But the public deserves and the Constitution guarantees more than this first step."
He argued that the companies should be allowed to reveal how often they turn over the content of users' communications as opposed to just "metadata," which only includes subscriber information, such as an email addresses.
Leslie Harris, the president and CEO of the Center for Democracy and Technology, applauded the companies for waging a legal battle with the intelligence agencies and for refusing to accept "transparency half-measures."
"The past day's events make clear that Congress should move forward immediately with the transparency reporting legislation introduced earlier this month in both the House and the Senate, rather than waiting to see if the Administration will deliver meaningful transparency on its own," Harris said in a statement.