The 258-163 vote on a nonbinding recommendation put Democrats controlling the House in a difficult spot and prompted senior lawmakers to postpone unveiling a House-Senate agreement on a homeland security funding bill.
If such a ban were to become law, the Obama administration would be hard-pressed to close the Guantanamo Bay prison by January as Obama has promised.
Eighty-eight Democrats broke with Obama and House leaders on the nonbinding recommendation, an ominous sign for future votes. It would be difficult for lawmakers to change their positions without drawing withering criticism from political adversaries.
The administration has yet to reveal its plan for closing the prison. Supporters of the transfer ban say an overwhelming number of their constituents want to keep Guantanamo prisoners where they are.
"There is no reason these terrorists, who pose a serious and documented threat to our nation, cannot be brought to justice right where they are in Cuba," said Rep. Harold Rogers, R-Ky. "I certainly think that is where the American people stand on this issue - they don't want these terrorists in their hometowns."
Supporters of closing Guantanamo say the facility and the lengthy detention of suspects who may have been held indefinitely without trial have stained the United States' reputation across the globe. And they said fears of bringing the detainees to the U.S. are exaggerated.
"I refuse to believe that our law enforcement officials, our prison officials and our Justice Department officials are not skilled enough and thoughtful enough to imprison these thugs in high-security facilities at minimal or no danger to our citizens and our communities," said House Appropriations Committee Chairman David Obey, D-Wis.
Several of the fiscal 2010 funding bills contain varying restrictions on the transfer of Guantanamo detainees, reflecting widespread opposition among voters about bringing enemy combatants onto U.S. soil. A bill pending on the Senate floor, for example, contains an outright ban on releasing Guantanamo detainees into the U.S.
The vote also put House members on record as backing the Obama administration's refusal to release new photos showing U.S. personnel abusing detainees held overseas.
President Barack Obama has already said he would use every available means to block release of additional detainee abuse photos because they could whip up anti-American sentiment overseas and endanger U.S. troops. His powers include issuing an order to classify the photos, thus blocking their release.