Federal prosecutors investigating last September's terror attacks suffered a legal setback this week when a federal judge in New York ruled that authorities cannot imprison people simply because they might have information useful to grand jury investigations. The ruling could have far-reaching implications for the government's anti-terrorism crackdown.

Federal Judge Shira Scheindlin ruled that the Justice Department has overreached by imprisoning so-called material witnesses, people whom authorities believe might have useful information for grand juries investigating terrorism but who are not themselves criminal suspects.

Judge Scheindlin dismissed perjury charges against a Jordanian student in New York who had allegedly lied to prosecutors about whether he knew two of the 19 September 11 hijackers.

Civil liberties groups welcomed the ruling as an indication that the government's anti-terror campaign has gone too far.

"I think it sends a clear message to the government that at least one judge very clearly says that the government should not misuse people who it thinks have important information but who themselves are not the target of any terrorism charges," said Kit Gage, Executive Director of the Washington-based First Amendment Foundation.

U.S. Attorney General John Ashcroft described the judge's ruling as "an anomaly" and said the Justice Department was considering an appeal.

"The department's use of material witness warrants is fully consistent with the law and longstanding practice. Numerous other judges have authorized the use of material witness warrants," Mr. Ashcroft noted.

At issue is the government's use of the material witness law to detain people who may have information relevant to investigations of the September 11 attacks. The law was enacted by Congress in 1984 and was designed to allow the government to detain individuals and compel them to testify before a grand jury.

But legal expert Eric Muller, a law professor at the University of North Carolina, says the judge ruled that the government went too far in employing the material witness statute.

"According to the judge, the law that Congress passed to allow this kind of detention did not actually extend to people being held in connection with investigations but only in connection with trials," he explained.

Professor Muller says the ruling could pose significant problems for the government's terrorism investigation if upheld either in federal appeals courts or by the U.S. Supreme Court.

"The government is using this material witness statute because it doesn't have any other grounds on which to hold a person like this," he said. "So, in the absence of this statute, if it is not able to hold people as material witnesses in connection with grand jury investigations, then the government is kind of stuck."

The government has not said how many people have been detained under material witness warrants. But human rights and legal watchdog groups have estimated that two dozen or so men have been held in the wake of the September attacks. Most of the hundreds of non-citizens detained in connection with the investigation have been held on immigration violations.