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 passes concealed carry gun bill GOP could punt funding fight to January McConnell PAC demands Moore return its money MORE (R-Ky.) and Zoe LofgrenZoe Ellen LofgrenAbortion-rights group endorses Nadler in race to replace Conyers on Judiciary Dems aim to elect Conyers replacement on Judiciary this month Conyers resigns amid sexual misconduct allegations 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 CottonTom CottonGOP and Dems bitterly divided by immigration Grassley offers DACA fix tied to tough enforcement measures Five things senators should ask Tom Cotton if he’s nominated to lead the CIA 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 LeeThe nearly 60 Dems who voted for impeachment Government study shows lack of diversity in tech House votes on US involvement in Yemen 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.