The National Security Agency paid millions of dollars to cover the costs of major internet companies involved in the Prism surveillance programme after a court ruled that some of the agency's activities were unconstitutional, according to top-secret documents.
The technology companies, which the NSA says include Google, Yahoo, Microsoft and Facebook, incurred the costs to meet new certification demands in the wake of the ruling from the Foreign Intelligence Surveillance court.
The October 2011 judgment, which was declassified on Wednesday by the Obama administration, found that the NSA's inability to separate purely domestic communications from foreign traffic violated the Fourth Amendment.
While the ruling did not concern the Prism programme directly, documents disclosed by whistleblower Edward Snowden describe the problems the decision created for the agency and the efforts required to bring operations into compliance. The material provides the first evidence of a financial relationship between the tech companies and the NSA.
The intelligence agency requires the surveillance court to sign annual "certifications" that provide the legal framework for surveillance operations. But in the wake of the court judgment these were only being renewed on a temporary basis while the agency worked on a solution to the processes that had been ruled illegal.
An NSA newsletter entry, marked top secret and dated December 2012, discloses the huge costs this entailed. "Last year's problems resulted in multiple extensions to the certifications' expiration dates which cost millions of dollars for Prism providers to implement each successive extension - costs covered by Special Source Operations," it says.
Special Source Operations handles all surveillance programmes, such as Prism, that rely on "corporate partnerships" with telecoms and internet providers to access communications data.
The disclosure that taxpayers' money was used to cover the companies' compliance costs raises new questions over the relationship between Silicon Valley and the NSA. Since the existence of the programme was first revealed on June 6, the companies have repeatedly denied all knowledge of it and insisted they only hand over user data in response to specific legal requests from the authorities.
An earlier undated newsletter states that the Prism providers were all given new certifications within days of the court ruling. "All Prism providers, except Yahoo and Google, were successfully transitioned to the new certifications. We expect Yahoo and Google to complete transitioning by Friday 6 October."
A Yahoo spokesman said: "Federal law requires the US government to reimburse providers for costs incurred to respond to compulsory legal process imposed by the government. We have requested reimbursement consistent with this law."
Asked about the reimbursement of costs relating to compliance with court certifications, Facebook responded by saying it had "never received any compensation in connection with responding to a government data request".