The High Court in London rejected an attempt by 10 detainees to win their freedom on Wednesday, upholding a ruling that Home Secretary David Blunkett was justified in accessing the men as a risk to national security.
That decision was made by the Special Immigration Appeals Commission, or SIAC, a legal tribunal which rules on the status of foreign nationals facing detention or deportation.
In a lengthy written ruling, a trio of judges turned down the appeal against the SIAC decision. If it had been successful the men's lawyers could have asked for their cases to be reconsidered.
The 10, none of whom have been named, have been detained for more than two and a half years under the Anti-Terrorism, Crime and Security Act, passed soon after the September 11 attacks on the United States in 2001.
Prison or expulsion
The law allows foreigners to be jailed indefinitely without charge or trial if the home secretary rules they are suspected of involvement in international terrorism, and they opt not to leave the country.
Two of the 10 have already chosen to leave Britain rather than stay in detention, although their cases are still considered.
The law has been savaged by human-rights groups, while last week an influential committee of parliamentarians said it should be scrapped "as a matter of urgency".
Blunkett has recently been dealt a pair of humiliating legal rebuffs over the law.
In April, SIAC ordered that an Algerian national, identified only as G, should be released into house arrest due to mental illness.
A month before that, a Libyan national suspected of links to the al-Qaida network, identified as M, walked free from jail after SIAC decided he was being detained on the basis of "wholly unreliable evidence".