Image caption The three users of the Twitter social network are associates of Wikileaks founder Julian Assange

A federal judge has ruled that the US government may demand that three associates of Julian Assange hand over Twitter account information in the criminal investigation into Wikileaks.

The three users of the social network had appealed against an earlier ruling.

Their legal team had argued the request was a violation of their constitutional rights of free speech and association.

The judge ruled that those freedoms do not shield members from complying with legitimate government investigations.

The American Civil Liberties Union (ACLU), the rights group which represented the Twitter users, said they planned to appeal against the ruling.

The three people concerned are Icelandic MP Birgitta Jonsdottir, Dutch hacker Rop Gonggrijp and US computer programmer Jacob Appelbaum.

A law that allows investigators to procure electronic data without a search warrant was invoked to demand information from the accounts of several Twitter users who are associates of Julian Assange.

The government order did not relate to Twitter messages but rather it sought to obtain internet protocol (IP) addresses and account details.

Government lawyers argued that that law, which only required that authorities demonstrate a reasonable belief in the information's relevance, is routinely used in criminal investigations like the Wikileaks probe.

Judge Theresa Buchanan sided with the government on the nature of the investigation, and argued that there was no constitutional violation.

"The Twitter Order does not seek to control or direct the content of petitioners' speech or association," she wrote in her ruling.

In a statement, ACLU lawyer Aden Fine said: "This ruling gives the government the ability to secretly amass private information related to individuals' internet communications.

"Except in extraordinary circumstances, the government should not be able to obtain this information in secret. That's not how our system works."