Ted Ullyot of Facebook
Facebook's Ullyot: "We frequently reject requests outright."

Facebook and Microsoft have revealed they passed on data from tens of thousands of users' accounts to the US government in the second half of last year, in response to demands from security agencies.

The admissions came as the two companies reached a deal with national security authorities in the US granting them permission to release the information.

The companies are fighting a public backlash after former CIA technical assistant Edward Snowden blew the whistle, claiming the two organisations were among nine internet companies that turned over user data to America's secret National Security Agency surveillance programme, code-named Prism.

Tech giants Facebook, Microsoft, Apple, Google and Yahoo have all denied allegations that the NSA can directly access their servers.

Facebook vice president and general counsel Ted Ullyot said the social networking site received between 9,000 and 10,000 requests from various "government entities" in the last six months of 2012, involving 18,000 to 19,000 of its users' accounts.

The requests covered issues ranging from missing children to tracking fugitives and terrorist threats, Ullyot said.

Facebook was not allowed to disclose the number of orders it received from a particular agency or on a particular subject. But the data include all national security requests including those submitted via national security letters and under the Foreign Intelligence Surveillance Act, which companies were previously not allowed to reveal.

Ullyot said Facebook wanted to reveal the information because of "confusion and inaccurate reporting" on the issue, and to show that only "a tiny fraction of 1%" of its 1.1 billion users have been affected.

Microsoft said it received between 6,000 and 7,000 "criminal and national security warrants, subpoenas and orders" affecting between 31,000 and 32,000 customers' accounts from local, state and federal governmental agencies over the same period.

Facebook, Microsoft and Google are pressing the Obama administration to reveal more about its government surveillance orders, including confidential requests made under the Foreign Intelligence Surveillance Act.

"We have always believed that it's important to differentiate between different types of government requests," Google said in a statement.

"We already publish criminal requests separately from National Security Letters. Lumping the two categories together would be a step back for users.

"Our request to the government is clear: to be able to publish aggregate numbers of national security requests, including FISA disclosures, separately."

Facebook repeated assurances that it scrutinised all government requests, and worked aggressively to protect users' data. The company said it had a compliance rate of 79% on government requests.

Ullyot said: "We frequently reject such requests outright, or require the government to substantially scale down its requests, or simply give the government much less data than it has requested. And we respond only as required by law.

"We're continuing to push for even more transparency, so that our users around the world can understand how infrequently we are asked to provide user data on national security grounds."

The US started a criminal investigation after Snowden blew the whistle on the NSA's vast electronic surveillance operation.

On Friday 14 June, US Attorney General Eric Holder said he was confident Snowden would be prosecuted for "extremely damaging" leaks.

The 29-year-old is in hiding in Hong Kong, and has vowed to fight any extradition bid.