NEW DELHI: Several US-based technology companies, including Google, Facebook, Microsoft and Yahoo, not only helped the National Security Agency in spying on their users but were also paid millions of dollars by the US government for their efforts.

The latest revelations are made by Guardian website that has received thousands of leaked NSA documents from Edward Snowden , who worked at the agency.

The report by Guardian noted that the money was paid by the NSA to technology companies after a US court ruled out some part of surveillance programme illegal in 2011. While the court order did not stop the surveillance, it reportedly asked NSA to implement several additional measures to safeguard the privacy of American citizens. This reportedly required change in the surveillance gear and mechanism used by the technology companies.

“While the ruling did not concern the Prism program directly, documents passed to Guardian by whistleblower Edward Snowden describe the problems the decision created for the agency and the efforts required to bring operations into compliance,” noted the report.

Prism, as alleged by Snowden, is a surveillance programme run by the NSA with the help of technology companies. Technology companies had earlier denied that they worked with the NSA for any programme called Prism.

"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," NSA reportedly noted in one of its documents in 2012.

