In a speech in Washington, the US secretary of state Hillary Clinton praised social networks for their positive role in protests in Tunisia and Egypt. However, the US government was in court the same day looking to reveal Twitter accounts linked to WikiLeaks.

Speaking for the Internet, Clinton spoke of the "freedom to connect". She said that the US supported Internet freedom and encouraged other countries to do the same. But she also added countries should not have to choose between "liberty and security, transparency and confidentiality."

The court case against Twitter revolves around the release of Pentagon and state department classified documents by WikiLeaks last year. Angered and embarrassed by the leaks, the US has set up a secret grand jury in Alexandria to investigate whether criminal charges can be leveled against WikiLeaks’ founder Julian Assange.

As part of that investigation the jury asked Twitter to reveal the details of the accounts of WikiLeaks and three people — Icelandic MP Birgitta Jonsdottir, Dutch hacker Rop Gonggrijp and US computer programmer Jacob Appelbaum — believed to be associated with WikiLeaks. Among the information Twitter was ordered to provide were IP addresses and the names and addresses of "tweet" recipients.

The investigation also covers the US soldier who was based in Iraq and is suspected of being behind the leak Bradley Manning. He is being held in a Virginia prison.

Lawyers for civil rights organisations were in the court in Alexandria, Virginia, to fight against a US government order.

A justice department lawyer told the court the request was a standard investigative measure.

American Civil Liberties Union lawyer Aden Fine spoke on behalf of all three plaintiffs in court. Fine said what is at stake is the ability to use the Internet freely and privately, without the government looking over people’s shoulder.

The judge has postponed a ruling on the case.