Google has escaped having to hand over billions of URLs and 2 month's worth of users' search queries following a Federal Judge's ruling.

Google had resisted the US Government's request for the data for worry that users would stop using the number one search engine over privacy fears.

However they did allow the Government the chance to demand to see 50,000 URLs.

Google in a statement on its blog said that it “will fully comply with the judge's order”.

Google is citing the judge's decision as “a clear victory for our users and for our company … Because we resisted the subpoena, the Department of Justice will not receive any search queries and only a small fraction of the URLs it originally requested”.

Subpoenas were issued to Google and three other internet search engines last year, seeking details of potentially billions of search queries as part of an investigation into online pornography.

The Justice Department also demanded a sample of the millions of websites archived in the search engines' databases.

Google who has run into censorship problems in China recently, said “We will always be subject to government subpoenas, but the fact that the judge sent a clear message about privacy is reassuring. What his ruling means is that neither the government nor anyone else has carte blanche when demanding data from Internet companies. When a party resists an overbroad subpoena, our legal process can be an effective check on such demands and be a protector of our users".