The House on Friday approved a compromise 2011 defense authorization bill that will now be considered by the Senate.
The 341-48 vote was held under the suspension of House rules, which required a two-thirds majority vote for passage.
The Guantánamo provision is a blow to President Obama, who has been fighting to close the prison viewed by many of his supporters as a blemish on the United States.
House and Senate leaders on military matters were still trying to figure out how the Guantánamo ban would play in the Senate, where unanimous consent would be needed to pass the defense policy bill in the few days left of the lame-duck session.
Rep. Ike Skelton (D-Mo.), the outgoing chairman of the House Armed Services Committee, agreed to include the detainee transfer ban after Republicans threatened to vote against the bill.
The bill will be named after Skelton, as a tribute to his many years on the committee and his work on behalf of the military. He lost his reelection bid in November.
The Democratic and Republican leaders of the congressional armed services committees earlier this week struck an agreement that could allow lawmakers to send a 2011 defense authorization act to the Pentagon.
Sens. Carl LevinCarl LevinFor the sake of American taxpayers, companies must pay their fair share What the Iran-Contra investigation can teach us about Russia probe Senate about to enter 'nuclear option' death spiral MORE (D-Mich.) and John McCainJohn McCainEx-Bush aide Nicolle Wallace to host MSNBC show Meghan McCain: Obama 'a dirty capitalist like the rest of us' Top commander: Don't bet on China reining in North Korea MORE (R-Ariz.), together with Skelton and Rep. Buck McKeon (R-Calif.) — the chairmen and ranking members of the Senate and House Armed Services panels — agreed on a pared-down defense authorization bill devoid of controversial items.
The Senate has failed twice this year to start debating the 2011 defense authorization bill because of Republican opposition to a provision to repeal a ban on openly gay people serving in the military. Congressional supporters of repeal instead resorted to standalone bills in the House and Senate.
The House earlier this year also passed its version of the 2011 defense authorization bill.
Among the items the lawmakers ditched in the new compromise 2011 defense authorization bill are specific authorization for a second F-35 Joint Strike Fighter engine, which had provoked a veto threat from the White House. The bill also does not include a provision allowing abortions to be performed in military hospitals.