The House on Friday approved a $491 billion spending bill for the Pentagon that seeks to prevent future prisoner transfers from Guantanamo Bay. 

The bill was approved in a 340-73 vote, with all but six of the "no" votes coming from Democrats.

The Obama administration has said it "strongly opposes" the bill, but has stopped short of a veto threat. It has objected to a restriction on transferring Guantanámo prisoners in the bill, as well as language that would prevent discussion of a new round of base closures.

The measure would provide $491 billion for military personnel, defense technology research and equipment procurement. Overall, the funding provided is $4.1 billion more than the current spending level and $201.8 million above the Obama administration's budget request.

The biggest surprise in the bill may be language putting limits on the National Security Agency. 

In a vote late Thursday night, the House adopted, by a 293-123 vote, an amendment offered by Reps. Thomas MassieThomas Harold MassieHouse conservatives to introduce amendments to omnibus Action on guns and immigration screeches to a halt in Congress Gun debate: Here are the proposals that Congress is considering MORE (R-Ky.) and Zoe LofgrenZoe Ellen LofgrenDems say 20 'poison pills' stand in way of spending deal Democrats propose .7 billion in grants for election security Live coverage: Trump delivers his first State of the Union MORE (D-Calif.) to prohibit the search of government databases for information on U.S. citizens without a warrant. 

"The American people are sick of being spied on," Massie said.

But House Judiciary Committee Chairman Bob Goodlatte (R-Va.) argued the amendment would potentially jeopardize national security by limiting the NSA's intelligence-gathering activities.

"This amendment would create a blind spot for the intelligence community tracking terrorists with direct connections to the U.S. homeland," Goodlatte said. "Such an impediment would put American lives at risk of another terrorist attack."

The House voted 230-184 to prevent the Obama administration from transferring detainees from Guantanamo Bay in light of the controversial exchange of U.S. Sgt. Bowe Bergdahl for five Taliban prisoners.

"It simply shows the judgment of this Congress, the people's representatives, that these remaining 149 detainees are too dangerous to be cavalierly released to a country without adequate constraints or notification to Congress," said Rep. Tom CottonThomas (Tom) Bryant CottonProtecting American innovation Russian spy poisoning brings world powers closer to day of reckoning GOP senators see Tillerson ouster as the new normal MORE (R-Ark.), the amendment's sponsor.

Rep. Jim Moran (D-Va.) offered an opposing amendment to do away with provisions in the bill that prohibit funds from being used to transfer Guantanamo Bay detainees or construct facilities to keep the prisoners in the U.S. But it was rejected 163-249.

"For far too long over the course of this war, we've let our fear triumph over our commitment to the rule of law," Moran said.

Also late Thursday night, the House defeated, 165-250, an amendment from Rep. Barbara LeeBarbara Jean LeeDeVos battles lawmakers in contentious hearing Senate Dem denounces Farrakhan's remarks Women's March leader defends attending event where speaker made anti-semitic remarks MORE (D-Calif.) that would prohibit the use of funds for new U.S. military intervention in Iraq as Sunni militants from extremist group the Islamic State in Iraq and Syria storm the country. Forty-four Democrats voted against it, including House Minority Whip Steny Hoyer (Md.) and House Assistant Minority Leader James Clyburn (S.C.). But House Minority Leader Nancy Pelosi (D-Calif.) voted for Lee's amendment.

"We must not let history repeat itself," Lee said. "These calls to be dragged back into Iraq must be rejected."

Another Lee amendment would effectively end the 2002 authorization of military force against Iraq, but it was rejected 182-231. Democratic leaders were similarly split in their votes on the amendment.

Rep. Rodney Frelinghuysen (R-N.J.), chairman of the House Appropriations subcommittee on Defense, said Lee's proposal would limit the U.S. government's ability to respond to the conflict.

"This amendment, in my judgment, goes too far, as it attempts to tie the U.S. government's hands," Frelinghuysen said.

Members late Thursday night rejected two Pentagon proposals to save money, including the retirement of the A-10 attack plane fleet and military base closures.

This is the fifth 2015 appropriations bill approved by the House.

The House also has passed appropriations bills for military construction and Veterans Affairs; the legislative branch; Commerce, Justice and science spending; and the Transportation and Housing and Urban Development departments.

Across the Capitol, the Senate has been unable to move forward on any fiscal 2015 appropriations bills.

The Obama administration has not yet released its recommendation for overseas contingency operations, but the House defense appropriations bill contains $79.4 billion for that account.

Members considered the defense appropriations bill under a special procedure that allowed members to offer an unlimited number of amendments with 10 minutes of debate each. In total, the House considered 80 amendments over the course of three days.