The Senate today passed a defense spending bill that provides an extra $50 billion for the wars in Iraq and Afghanistan and includes an amendment -- opposed by the White House -- that prohibits the mistreatment of detainees in U.S. custody.

Rushing to complete the bill before leaving for a 10-day recess, senators voted 97-0 to approve the $440 billion measure, which funds military operations for the 2006 fiscal year that began Oct. 1.

In a separate vote, the Senate approved a $31.9 billion budget for the Department of Homeland Security. The measure gives the department a 5 percent increase, with some of the new funding earmarked to help pay for additional Border Patrol agents.

The Senate defense bill must now be reconciled with a separate House version, and negotiators are expected to convene in the coming weeks to work out differences. The House bill, which was passed in July, provides more than $30 billion less in military spending than the Senate version.

Both bills include a 3.1 percent military pay increase and additional benefits for military personnel.

If the final bill includes the full $50 billion in extra war funding, it would push spending in Iraq and Afghanistan since the Sept. 11, 2001, terrorist attacks to more than $360 billion.

The Bush administration did not request more money for war operations, but military officers informed senators that the additional funding will be needed by the middle of next month.

The White House has threatened a presidential veto of the bill because senators included the ban on mistreatment of detainees and trimmed up to $7 billion from the administration's requested appropriation. The trims, which apply to budget areas apart from those covered by the extra $50 billion, would cut Air Force space programs and eliminate one of four ships requested by the Navy.

The Senate voted 90-9 Wednesday in favor of an amendment sponsored by Sen. John McCain (R-Ariz.) that would prohibit "cruel, inhuman or degrading treatment or punishment" of anyone in U.S. military custody. McCain, a former Navy pilot who was shot down over Hanoi during the Vietnam war and spent more than five years as a POW, introduced the amendment over White House objections in an effort to repair damage from the abuse of detainees in Iraq and elsewhere and to give U.S. military interrogators clear guidelines. The bill would restrict interrogation techniques to those authorized in a U.S. Army field manual.

The White House opposed the amendment on grounds that it would constrain the executive branch's options and duplicate restrictions that are already in place.

In a statement repeating the veto threat, the White House said Wednesday that the provision would "restrict the president's authority to protect Americans effectively from terrorist attack" and would reduce America's ability to bring terrorists to justice.