The White House on Thursday threatened to veto the 2012 National Defense Authorization Act because a series of the bill’s provisions would mandate military custody for some terrorism suspects and prevent the administration from transferring detainees out of the military prison at Guantanamo Bay, Cuba.

“Any bill that challenges or constrains the President’s critical authorities to collect intelligence, incapacitate dangerous terrorists, and protect the Nation would prompt the President’s senior advisers to recommend a veto,” the White House said in a statement.

The language on detention, which has divided Democrats on Capitol Hill, sets up a clash between Congress and the White House over a measure that would authorize $526 billion for the Defense Department budget.

The human rights community welcomed the veto threat.

“The bill tosses out the most effective tool for countering terrorism — civilian law enforcement — and makes the U.S. military the world’s jailor,” said Andrea Prasow, senior counterterrorism counsel at Human Rights Watch.

The administration argued that some of the measures Congress proposed could upend the law that has emerged over the past decade regarding whom the government can detain.

“The Administration strongly objects to the military custody provision,” the White House said, noting that it could apply to people in the United States. That “would raise serious and unsettled legal questions and would be inconsistent with the fundamental American principle that our military does not patrol our streets.”

The latest version of the National Defense Authorization Act left the Senate Armed Services Committee this week with amended detention provisions after the White House objected to the original version. But the measure continued to draw criticism from the White House and leading Democrats, including Sen. Dianne Feinstein (Calif), the chairman of the intelligence committee, and Sen. Patrick J. Leahy (Vt.), the chairman of the Judiciary Committee.

But Sen. Carl M. Levin (D-Mich.), the chairman of the Armed Services Committee, and Sen. John McCain (Ariz.), the panel’s ranking Republican, said the measure would preserve the administration’s ability to make different detention choices. And they urged the White House to back their efforts.