US lawmakers voted Wednesday to kill efforts to close the Guantanamo Bay prison for suspected terrorists in 2011 or try the alleged mastermind of the September 11, 2001 attacks on US soil.

The House of Representatives voted 212-206 for a catch-all spending bill covering government expenses in the fiscal year that began October 1, a measure that included the restrictions affecting Guantanamo and its detainees.

The legislation prohibits President Barack Obama from spending any money to transfer prisoners to US soil or to acquire facilities to hold them on US soil.

It also explicitly bars the transfer of the confessed Al-Qaeda mastermind of the September 11 attacks Khalid Sheik Mohammed to the US mainland or US territories.

"None of the funds made available in this or any prior Act may be used to transfer, release, or assist in the transfer or release to or within the United States, its territories, or possessions Khalid Sheikh Mohammed or any other detainee" held at Guantanamo Bay as of June 24, 2009, the bill says.

To become law, the Senate must approve the same legislation, sending it to Obama to sign into law.

The president vowed during his 2008 quest for the White House to shutter the notorious facility, and even signed an executive order shortly after taking office to do so, but ran into unyielding opposition from the US Congress.

The prison, located on the Guantanamo naval base in Cuba, currently holds around 170 detainees, including three who have been convicted and 58 who have been placed in indefinite detention without trial.

Scores of other inmates have been transferred to third countries, where they have been released.

Efforts to try some Guantanamo detainees in civilian courts were dealt a major blow last month when a jury cleared a former inmate of all but one of the 286 charges brought against him for the 1998 US embassy bombings in Africa.