Updated

The House on Thursday backed election-year legislation that would temporarily halt the transfer of more terror suspects from the U.S. naval prison at Guantanamo Bay, Cuba.

The bill, which passed on a 244-174 vote, would bar the federal government from spending money on any Guantanamo prisoner transfers, even those to a foreign country. The ban would last until the end of the calendar year, or until a bill authorizing defense funding is signed into law.

The White House has threatened to veto the legislation, and it has no chance of becoming law. But the bill is an opportunity for Republicans to get Democrats on record on the issue in the weeks before the election and use their votes against them in campaigns.

Republicans supporting the bill said the transfers could allow some detainees to eventually return to terrorism and could threaten American communities when prisoners are transferred to prisons on U.S. soil.

Rep. Randy Forbes, R-Va., said that when these prisoners are held in a jail or prison in the United States, "you have just put a target on every school, every business, every mall in that community."

The White House argues Guantanamo weakens national security by draining resources and emboldening violent extremists. About 60 prisoners are being held there, down from hundreds. The administration says transfers occur only after a rigorous review.

Democrats said the legislation would strip Obama of his lawful authority over the prison.

"This bill is un-American and extreme," said Rep. Jerrold Nadler of New York.