NSA Prism 2013 The AP
An anti-PRISM demonstration. Associated Press

The National Security Agency paid tech companies participating in its PRISM electronic surveillance program millions of dollars to cover the cost of handing over emails and other electronic communications to the federal government. Those companies include Facebook (NASDAQ:FB), Google (NASDAQ:GOOG), Yahoo (NASDAQ:YHOO), and Microsoft (NASDAQ:MSFT).

The payments, reported by the Guardian and based on documents provided by former NSA contractor Edward Snowden, represent the first evidence of a financial relationship between the electronic spy agency and major Internet companies.

The payments came after an October 2011 ruling by the Foreign Intelligence Surveillance Court, which oversees the NSA’s programs, found that a portion of the NSA’s collection operations was scooping up thousands of Americans' emails illegally. As a result of the ruling, the NSA had to issue new certifications for the tech companies to continue co-operating with its demands for data. Though the ruling did not directly concern the PRISM program -- which required tech companies to hand over communications requested by the NSA -- it evidently created costly compliance issues.

A redacted version of that opinion was released on Wednesday.

"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," an NSA newsletter from last December said of the situation.

"Microsoft only complies with court orders because it is legally ordered to, not because it is reimbursed for the work,” a spokesperson for Microsoft told the Guardian. “We could have a more informed discussion of these issues if providers could share additional information, including aggregate statistics on the number of any national security orders they may receive."

A Yahoo spokesperson told the Guardian that "federal law requires the U.S. government to reimburse providers for costs incurred to respond to compulsory legal process imposed by the government” and the company has “requested reimbursement consistent with this law."