WASHINGTON (AP) — Congress and the White House are headed for a showdown over a massive, $662 billion defense bill that would require the military to hold suspected terrorists linked to al-Qaida or its affiliates, even those captured on U.S. soil, and detain some indefinitely without trial.

The Senate voted 93-7 Thursday night for the legislation, which must be reconciled with a House-passed version in the closing days of the session. The White House has threatened a veto of the Senate bill over the policies on handling terror suspects and has criticized similar provisions in the House bill.

Overall, the bill would authorize money for military personnel, weapons systems, national security programs in the Energy Department, and the wars in Iraq and Afghanistan in the fiscal year that began Oct. 1. Reflecting a period of austerity and a winding down of decade-old conflicts, the bill is $27 billion less than President Barack Obama requested and $43 billion less than Congress gave the Pentagon this year.

In a resounding vote, the Senate unanimously backed an amendment to impose harsh sanctions on Iran as fears about Tehran developing a nuclear weapon outweighed concerns about driving up oil prices that would hit economically strapped Americans at the gas pump.

"Iran's actions are unacceptable and pose a danger to the United States and the entire world," said Senate Majority Leader Harry Reid, D-Nev.

In an escalating fight with the White House, the bill would ramp up the role of the military in handling terror suspects. Defense Secretary Leon Panetta and FBI Director Robert Mueller both oppose the provisions as does the White House, which said it cannot accept any legislation that "challenges or constrains the president's authorities to collect intelligence, incapacitate dangerous terrorists and protect the nation."

Late Thursday, a White House official said the veto threat still stands.

The bill would require military custody of a suspect deemed to be a member of al-Qaida or its affiliates and involved in plotting or committing attacks on the United States. American citizens would be exempt. The bill does allow the executive branch to waive the authority based on national security and hold a suspect in civilian custody.

The legislation also would deny suspected terrorists, even U.S. citizens seized within the nation's borders, the right to trial and subject them to indefinite detention.

The series of detention provisions challenges citizens' constitutional rights, tests the boundaries of executive and legislative branch authority and sets up a confrontation with the Democratic commander in chief. Civil rights groups fiercely oppose the bill.

"The bill is an historic threat to American citizens and others because it expands and makes permanent the authority of the president to order the military to imprison without charge or trial American citizens," said Christopher Anders, ACLU senior legislative counsel.

The bill reflects the politically charged dispute over whether to treat suspected terrorists as prisoners of war or criminals. The administration insists that the military, law enforcement and intelligence agents need flexibility in prosecuting the war on terror after they've succeeded in killing Osama bin Laden and Anwar al-Awlaki.

Republicans counter that their efforts are necessary to respond to an evolving, post-Sept. 11 threat, and that Obama has failed to produce a consistent policy on handling terror suspects.

The House-passed bill would limit Obama's authority to transfer terrorist suspects from the U.S. naval facility at Guantanamo Bay, Cuba, to installations in the United States, even for trial. It also would make it difficult for the administration to move detainees to foreign countries.

On Iran, Sens. Bob Menendez, D-N.J., and Mark Kirk, R-Ill., had widespread bipartisan support for their amendment, which would target foreign financial institutions that do business with the Central Bank, barring them from opening or maintaining correspondent operations in the United States. It would apply to foreign central banks only for transactions that involve the sale or purchase of petroleum or petroleum products.

The sanctions on petroleum would only apply if the president determines there is a sufficient alternative supply and if the country with jurisdiction over the financial institution has not significantly reduced its purchases of Iranian oil.