"The delirium caused by the bombings turned in the direction of a deportation crusade with the spontaneity of water seeking out the course of least resistance." So wrote Louis F. Post about the Palmer Raids of 1919-20, when the federal government responded to a series of terrorist bombings by rounding up thousands of foreigners, not for their connection to the bombings but for technical immigration violations and association with various factions of the Communist Party.

Post's description equally captures the Bush administration's response to the terrorist attacks of Sept. 11, 2001. Once again the government pursued "the course of least resistance," rounding up thousands of foreigners, not for terrorist activity but for technical immigration violations. Many were arrested in secret, held without charges, denied access to lawyers, presumed guilty until proven innocent, tried in secret, and kept locked up long after their cases were fully resolved. In the name of "preventing terrorism," the government has locked up more than 5,000 foreigners who had nothing to do with terrorism.

For 21/2 years, little has been done to rectify this situation. But today several senators and representatives plan to introduce the Civil Liberties Restoration Act of 2004, a bill that seeks to ensure that the next time we suffer a terrorist attack, we will hold fast to basic principles of fairness, due process and human rights, especially in our treatment of foreign nationals.

The act would bar the practice of blanket secret trials, reserving secrecy for cases in which the government can demonstrate a specific need. It would require that when the government locks someone up, it must inform him of the charges within 48 hours, and bring him before a judge within three days. It would limit preventive detention to situations in which the government actually has evidence that an individual poses a risk of flight or a danger to the community. And it would end "special registration," which selectively targeted men from Arab and Muslim countries for fingerprints, photographs and interrogations.

But why should Americans care about the rights of foreign nationals? Especially when we are at war with a terrorist organization made up almost exclusively of foreigners, shouldn't we be careful to preserve the government's ability to target immigrants?

We should care for three reasons. First, the government's anti-immigrant measures have made us less, not more, secure. Of the more than 5,000 foreign nationals subject to preventive detention, for example, none has been charged with being associated with al Qaeda or with complicity in the attacks of Sept. 11. Only three have been charged with any terrorist crime at all, and two of those three were acquitted of the terrorism charges at trial. The lone conviction is now under a cloud because the prosecution failed to disclose to the defense evidence that its principal witness lied on the stand.

The most extensive campaign of ethnic profiling in this country since World War II has thus far failed to disclose a single terrorist. More than 80,000 foreign men were compelled to register, be fingerprinted and photographed merely because they came from predominantly Arab or Muslim countries. Another 8,000 men were called in for FBI interviews, again merely because they were from Arab and Muslim countries. And 6,000 more were prioritized for deportation, for the same reasons. Yet not one of these people has been charged with a terrorist crime.

And while these measures have yielded no security gains, they have alienated the very communities the government most needs to work with if it is going to find the al Qaeda supporters who seek to kill us. That makes it less likely that we will get the cooperation we need, and more likely that the terrorists will find willing recruits.

Second, history suggests that what the government does to foreigners in the name of national security it will ultimately do to citizens as well. The Palmer Raids were directed at foreigners, but their architect, a young Justice Department lawyer named J. Edgar Hoover, was not content to stop there. He devoted his career to seeking out ways to extend those tactics to citizens, and in the McCarthy era, he succeeded. In fact, every significant form of political repression that the government has used against citizens began as an anti-alien measure.

So we should support the Civil Liberties Restoration Act because it is in our interest to do so. But there's still another reason: It's the right thing to do. The rights not to be locked up arbitrarily, tried in secret, held without charges, or discriminated against based on national origin or religion are not privileges of U.S. citizenship, but basic human rights. They belong to all of us, regardless of status.

The writer is a law professor at Georgetown University and the author of "Enemy Aliens: Double Standards and Constitutional Freedoms in the War on Terrorism."