The U.S. Senate on Thursday night struck a bipartisan deal that modified controversial language in a major defense policy bill which had drawn strong opposition from critics in both parties, who charged it would allow the indefinite detention of American citizens by the military.

The 99-1 vote came after several days of heated debate on the Senate floor over whether this defense bill really changed how U.S. citizens accused of supporting terrorists would be treated, or if critics were right that U.S. citizens could be held by the military indefinitely without the filing of formal charges.

Compromise language developed in part by Sen. Dianne Feinstein (D-CA) was ultimately approved, which read as follows:

"Nothing in this section shall be construed to affect existing law or authorities relating to the detention of United States citizens or lawful resident aliens of the United States, or any other persons who are captured or arrested in the United States."

The compromise won almost unanimous support, as Senate Armed Services Committee Chair Carl Levin (D-MI) said he would fight to protect that language in upcoming House-Senate negotiations; it was unclear whether the language would be accepted by the White House, which has threatened to veto the entire defense bill.

Earlier, the Senate had twice defeated efforts to water down the detainee provisions in this bill, as a majority of Republicans joined with a dozen Democrats to keep detainee language that some Senators said allowed for indefinite military detention of civilians, a charge that leading Republicans like Sen. John McCain (R-AZ) bitterly disputed.

Backers of the bill's original language wanted more power for the military to deal with terror suspects, even if they were Americans arrested on U.S. soil.

"The Obama Administration's decision to detain people as enemy combatants is within the President's power to do so," argued Sen. Lindsey Graham (R-SC), who said American citizens can already be detained indefinitely, as he brushed off charges that this bill would wrongly restrict important constitutional rights.

Graham, who backed the bill's original language, spoke on the Senate floor about the phone calls his office was receiving on the matter, bluntly saying that critics of the bill were misinformed about any change in how long U.S. citizens could be held by the military.

"The Supreme Court will decide who can be detained," said Sen. Richard Durbin (D-IL), who opposed the original detainee language.

"The United States Senate will not," Durbin added.

Next stop for this fight over the military's rules on terror detainees arrested in the U.S. will be in a House-Senate conference committee in coming days.