The National Security Agency paid Google, Facebook and other Silicon Valley companies millions of dollars to cover the cost of complying with surveillance requests, according to the latest report from The Guardian.

Former NSA contractor Edward Snowden provided The Guardian with a December 2012 document stating that the agency’s “Special Source Operations” paid the companies millions of dollars to cover costs associated with legal certifications under the agency’s Internet surveillance program, PRISM.

Google, Facebook, Yahoo and Microsoft all received money from the NSA, according to the report.

The companies have all insisted that they comply only with specific legal requests for information and that they work hard to protect their users’ privacy rights.

The government is required to reimburse companies for surveillance compliance costs, but privacy advocates worry about communications providers profiting from allowing the government to spy on their users.

“Federal law requires the U.S. 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,” a Yahoo spokeswoman said.