ALEXANDRIA, Va. – A federal magistrate ruled Friday that prosecutors can demand Twitter account information of certain users in their criminal probe into the disclosure of classified documents on WikiLeaks.

The prosecutors’ reasons for seeking the records remain secret, and it’s unknown how important they are to the investigation of the largest leak ever of classified American documents.

The Twitter users argued that the government was on a fishing expedition that amounted to an unconstitutional violation of their freedoms of speech and association.

But in a 20-page ruling issued Friday, U.S. Magistrate Judge Theresa Carroll Buchanan said the government’s request was reasonable and did nothing to hamper the Twitter users’ free speech rights.

“The freedom of association does not shield members from cooperating with legitimate government investigations,” Buchanan wrote.

The efforts by the Twitter users marked the first legal skirmish in the Justice Department’s criminal investigation of the WikiLeaks disclosures. The Twitter users’ lawyers, including the American Civil Liberties Union and the Electronic Frontier Foundation, have said they will appeal.

Cindy Cohn, the Electronic Frontier Foundation’s legal director, said she was troubled by several aspects of Buchanan’s ruling, including a technical ruling that the Twitter users lack legal standing to challenge the judge’s order at all and a ruling that keeps much of the case under seal.

“What we don’t know is who else they’re trying to get information from,” Cohn said.

Prosecutors have said little about their case, though Attorney General Eric Holder has said that the leaks jeopardized national security.

Prosecutors submitted their rationale for seeking the Twitter accounts to Buchanan, but that submission remains secret. In her ruling, Buchanan said only that she “remains convinced that the application stated ‘specific and articulable’ facts sufficient to issue” the order.

Steven Aftergood, who works on government secrecy policy for the Federation of American Scientists, said the government’s aggressive pursuit of the Twitter accounts reflects one of two possibilities.

“Either the government is being extremely diligent in crossing every ‘t’ and dotting every ‘i’. Or the other possibility is that they have no case whatsoever and they’re tallying up all conceivable leads,” he said.

A federal law allows prosecutors to obtain certain electronic data without a search warrant or a demonstration of probable cause. Instead, the government must show only that it has a reasonable belief that the records it seeks are relevant to an ongoing criminal investigation.

Prosecutors said the law is used routinely in criminal inquiries, and that the WikiLeaks investigation is no different from any other criminal probe.

The U.S. Attorney’s Office for the Eastern District of Virginia, which is investigating the WikiLeaks case, declined comment after Friday’s hearing.

Buchanan said the Twitter users had no reason to expect that the information sought by prosecutors would be kept private. The order does not seek the content of the tweets themselves, which are already publicly disseminated. Instead, it seeks “non-content” information, like billing records and IP addresses associated with the accounts.