WASHINGTON -- Ignoring a presidential veto threat, the Democratic-controlled Senate on Thursday overwhelmingly approved a $662 billion defense bill that would require the military to hold suspected terrorists linked to al-Qaida or its affiliates, even those captured on American soil, and detain some indefinitely.

The vote was 93-7 for the bill authorizing 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 what President Barack Obama requested and $43 billion less than what Congress gave the Pentagon this year.

Shortly before final passage, the Senate unanimously backed crippling 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.

The vote on the sanctions was 100-0.

"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. "Iran supports terrorist groups, arms the killers of American soldiers, lies about its nuclear program, violates its citizens' basic rights and threatens Israel's security."

The Senate's version of the defense bill still must be reconciled with the House-passed measure in the final weeks of the congressional session.

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 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."

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.