The House overwhelmingly passed a $570 billion defense spending bill Friday that, besides funding the usual military facilities and assets, places strict limitations on government surveillance and restricts President Barack Obama’s discretion on Guantanamo Bay Detention Center.

H.R. 4870, or the Department of Defense Appropriations Act of 2015, handily passed the Republican-controlled House of Representatives by a vote of 340-73.

A bipartisan civil libertarian coalition headed efforts to limit spying permissions. The act bars using the National Security Agency specifically from using funds to pursue data via Sections 702 and 501 of the Foreign Intelligence Surveillance Act of 1978, which authorized the “bulk metadata” collection exposed by NSA whistleblower Edward Snowden.

The bill blocks government surveillance entities from using data collected from foreign intelligence services if that information was collected in violation of the Fourth Amendment and blocks surveillance agencies from pursuing telecom and Internet companies to build “back doors” in their products for government exploitation.

Huffington Post White House Correspondent Sam Stein said on Twitter that President Obama's request to extend the metadata program was approved today.

If passed by the Senate, the act also would prevent the Obama administration from transferring any detainees from Guantanamo Bay in the 2015 fiscal year. The prohibition is seemingly a direct result of the general congressional disapproval of Obama’s swap of five high-level Guantanamo Bay detainees for Army Sgt. Bowe Bergdahl on May 31. The White House argued it acted out of direct concern for Bergdahl’s life.

Two subcommittees in the House Foreign Affairs Committee held a hearing on Wednesday to determine if the exchange hurt national security.

The Obama administration says it strongly opposes the spending bill, arguing against the Guantanamo Bay restrictions and roadblocks to Pentagon cost-cutting plans.

Notable military allocations include the preservation of the A-10 “Warthog” aircraft fleet, which was in danger of being retired, $800 million to refuel the USS George Washington aircraft carrier and funding for 38 F-35 Joint Strike Fighters (four more than the Pentagon requested).

The act appropriates $830 million less for military personnel spending and $360 million less for military health and family spending than what the White House requested. Still, it will fund a 1.8 percent pay raise for military personnel. The White House plan was to give a 1 percent pay raise and use more funds for training and equipment maintenance.

The House rejected a proposal to block combat operations in Iraq a day after Obama announced that 300 military personnel would go to the country to advise the Iraqi government during their campaign against the extremist Islamic State in Iraq and Syria.

The act will have to pass the Senate and get the president's signature to become law. Obama has not confirmed whether or not he will ultimately veto the bill if and when it makes it to his desk.

H.R. 4870 can be seen in full here.