The Republican-led House on Friday overwhelmingly approved a $570 billion defense bill that halts any Guantanamo transfers for a year in the furor over the American-for-Taliban swap and pulls back government spying.

The vote was 340-73 for the legislation that provides money for military operations in Iraq and Afghanistan, personnel, ships and aircraft. An unusual coalition of libertarian Republicans and liberal Democrats pushed through new limits on National Security Agency surveillance as the year-old revelations of bulk collection of millions of Americans' phone records still roil the debate of security vs. privacy.

The White House has objected to the legislation, which must be reconciled with a still-to-be written version from the Democratic-led Senate.

Pushing through the bill over three days, Republicans railed against President Barack Obama's decision last month to swap five Taliban leaders who had been held at Guantanamo for more than a decade for Sgt. Bowe Bergdahl, a captive for five years in Afghanistan. The Taliban were transferred to Qatar, where they must remain for a year.

Republicans said Obama broke the law, failing to notify Congress within 30 days, and increased the terrorism risk to the United States with the exchange.

Obama has defended the deal to spare Bergdahl as the administration has tried to reduce the population of Guantanamo, where 149 are being held.