The House of Representatives voted on Thursday to allow Guantanamo Bay detainees to be brought to the U.S. mainland to face trial.

The measure, which passed by a count of 307-114, is seen as a positive step toward the administration's goal of closing the divisive prison by January.

The provision was part of a Homeland Security appropriations bill that funds the department for next year. The bill awaits passage in the Senate before President Barack Obama can sign it into law.

Many Republicans opposed the measure, saying that trials of terror suspects in American courts could pose security issues and would offer legal protections to undeserving individuals. Rep. Jason Chaffetz (R-Utah) Tweeted after the vote, "I voted NO on Homeland Security bill ... it let's [sic] GITMO detainees into USA and is a 22% increase in overall appropriations."

The bill, however, does not include permission for the detainees to be housed in prisons on the U.S. mainland en masse, another proposal deeply unpopular with Republicans. The provision only allows prisoners to be transferred to the U.S. if they are to stand trial.

Though the closure of the Guantanamo Bay prison was one of the first promises Obama made at the outset of his presidency, his administration has faced many obstacles in its effort to shutter it before a self-imposed January deadline.

Congress has demanded that the president provide a plan to shut down the prison before authorizing its closure.