The 307 to 114 vote on Thursday is a key step towards the stated aim of Barack Obama, the US president, to empty the prison camp by January.
The measure, which will also allow the Pentagon to ban the release of photos showing the abuse of terrorism suspects, will now go to a vote in the Democrat-controlled US senate before Obama can sign it into law.
Republicans have said that allowing Guantanamo detainees to face trial in US courts could create security risks.
Obama issued an order on his second day in office that the camp be shut down within a year, but political, legal and diplomatic obstacles have arrested progress towards that target.
Many politicians in congress have said that they are concerned that housing terrorism suspects in US prisons could encourage attacks against the US mainland.
The prison camp at Guantanamo has faced global criticism after it emerged that interrogation methods deemed by some rights groups to be torture, were used on inmates there.
Officials from the Obama administration have said that they want the prison shut as soon as possible, arguing that it stands as a potent recruiting symbol for groups such as al-Qaeda.
But congress has on several occasions denied granting the administration the funding needed to shut down the centre, which is still holding about 220 inmates.
Congress has argued that it needs to see a detailed plan for the facility's closure first.
Under the compromise passed by the House of Representatives on Thursday, the government can only bring Guantanamo inmates to US soil if they are going to face trial in American courts.
The Obama administration would also have to present a risk assessment and give 14 days' notice of its attempt to bring an inmate to the US.
The vote comes as Lindsey Graham, a Republican senator, continues his attempt to prevent prisoners held at Guantanamo who are suspected of involvement in the September 11, 2001 attacks from being tried in US courts.
Not all of those held at Guantanamo will face criminal prosecution in the US – some could be tried in US military tribunals at the prison camp, while others who have been cleared may be sent to other countries.
Source: Al Jazeera (English)