WASHINGTON -- The Senate voted late on Thursday to prohibit the government from imprisoning American citizens and green card holders apprehended in the United States in indefinite detention without trial.
While the move appeared to bolster protections for domestic civil liberties, it was opposed by an array of rights groups who claimed it implied that other types of people inside the United States could be placed in military detention, opening the door to using the military to perform police functions.
The measure was an amendment to this year's National Defense Authorization Act, which is now pending on the Senate floor, and was sponsored by Senators Dianne Feinstein, Democrat of California, and Mike Lee, Republican of Utah. The Senate approved adding it to the bill by a vote of 67 to 29.
"What if something happens and you are of the wrong race in the wrong place at the wrong time and you are picked up and held without trial or charge in detention ad infinitum?" Ms. Feinstein said during the floor debate. "We want to clarify that that isn't the case -- that the law does not permit an American or a legal resident to be picked up and held without end, without charge or trial."
The power of the government to imprison, without trial, Americans accused of ties to terrorism has been in dispute for a decade. Under the Bush administration, the executive branch imprisoned as "enemy combatants" an American picked up on the battlefield in Afghanistan, Yasser Hamdi, and one arrested in Chicago and accused of being a Qaeda operative, Jose Padilla.
The Supreme Court eventually ruled that it was lawful to hold Mr. Hamdi in military detention, but that he was entitled to a hearing before a neutral arbiter to make sure he was indeed a combatant. A federal appeals court panel also approved the detention of Mr. Padilla, but before the Supreme Court could review that decision, the Bush administration returned him to the civilian court system, where he was tried and convicted.
Last year, in the previous annual version of the National Defense Authorization Act, Congress included a provision stating that the government had the authority to detain Qaeda members and their supporters as part of the war authorized shortly after the terrorist attacks of Sept. 11, 2001. But lawmakers could not decide, and left it deliberately ambiguous, whether that authority extended to people arrested on American soil.
This year, a group of plaintiffs, including the American journalist Chris Hedges, challenged that law, arguing that its existence chilled their constitutional rights by creating a basis to fear that the government might seek to detain them under it by declaring that their activities made them supporters of an enemy group.
In September, a federal judge issued an injunction barring the government from enforcing the statute. The Obama administration has appealed that ruling, and the injunction has been stayed pending the resolution of the case.
Meanwhile, the lawfulness of holding even people accused of being terrorist operatives, as Mr. Padilla was, in military detention without trial remains in dispute. Ms. Feinstein, arguing that law enforcement officials have proved capable of handling cases that arise on domestic soil, said the amendment was intended to "clarify" that the government may not put Americans arrested domestically in military detention.
She said that it was appropriate to detain, interrogate and punish Americans who joined in terrorist plots, but that allowing indefinite detention could violate the rights of innocent people. She invoked the internment of Japanese-Americans during World War II, something she said remained a "stain" on the nation's history.
Senator Kelly Ayotte, Republican of New Hampshire, objected to the restriction on security grounds, saying that even American citizens arrested inside the United States on suspicion of planning a terrorist attack for Al Qaeda should be held under the laws of war and interrogated without receiving the protections of ordinary criminal suspects, like a Miranda warning of a right to remain silent.
She stood in front of a poster of Anwar al-Awlaki, the American citizen and radical Muslim cleric who was killed by an American drone strike in Yemen last year, holding a rocket-propelled grenade launcher. She argued that it did not make sense to say the United States could "use a drone attack" against him if he was overseas, but would give him the right to remain silent if he made it to the United States.
From the other direction, an array of civil liberties and human rights groups -- including the American Civil Liberties Union and Human Rights First -- strongly objected to the Feinstein amendment because it was limited to citizens and lawful permanent residents, as opposed to all people who are apprehended on United States soil.
They argued that it implied that there were two classes of people, and that others -- like foreigners who were in the country as students or tourists -- could be placed in military detention. This would open the door to using the military in domestic operations, they argued, and would contradict the Constitution's guarantee that no "person" within the United States could be deprived of liberty without due process.
"Senator Dianne Feinstein has introduced an amendment that superficially looks like it could help, but in fact, would cause harm," said Chris Anders of the A.C.L.U. "It might look like a fix, but it breaks things further."
But on the floor, Ms. Feinstein said that she limited the amendment to citizens and green card holders because she believed that language would "get the maximum number of votes in this body."
The National Defense Authorization Act contains several other provisions related to recurring controversies over detention, including extending restrictions on the government's ability to transfer detainees away from the military prison at Guantánamo Bay, Cuba. Since Congress imposed those restrictions, the transfer of low-level prisoners has slowed almost to a halt, calling into question whether President Obama's stated policy goal of closing the prison is dead.
On Thursday, the White House issued a statement of administration policy threatening that Mr. Obama would veto the National Defense Authorization Act if Congress passed it in its current form. It included more than a dozen objections to various provisions.
The first section the statement listed was the one extending the restrictions on detainees, which it said "interferes with the executive's ability to make important foreign policy and national security determinations, and would in certain circumstances violate constitutional separation of powers principles."
Also on Thursday, the Senate voted, 62 to 33, for a nonbinding amendment calling for an accelerated withdrawal of United States combat forces from Afghanistan. The measure was sponsored by Senator Jeff Merkley, Democrat of Oregon, and was backed by 13 Republicans.
"It is time to end this war, end the longest war in United States history," Mr. Merkley said.
This article originally appeared in The New York Times.