The US Senate has decided not to consider a measure to give Guantanamo detainees and other foreigners the right to challenge their detention in the courts.

The draft legislation needed approval by 60 votes in order to be considered in the Senate, which is narrowly controlled by Democrats. It received only 56, with 43 voting against.

Congress last year eliminated the right to habeas corpus for non-US citizens labeled 'enemy combatants' by the government.

The Bush administration said this was necessary to prevent them from being set free and attacking Americans.

The move affected about 340 suspected al-Qaeda and Taliban captives held at the Guantanamo Bay naval base in Cuba.

It could also affect millions of permanent legal residents of the US who are not US citizens, according to one of the sponsors of the bipartisan measure, Democratic Senator Patrick Leahy of Vermont.

Senator Arlen Specter, another sponsor of the bill and a Pennsylvania Republican, noted that the right to habeas corpus was a protection against arbitrary arrest enshrined in the US Constitution and dating back to the English Magna Carta of 1215.

Later this year, the US Supreme Court is expected to hear arguments from lawyers for Guantanamo prisoners challenging the law that restricted the right to habeas corpus.