The law lords have today ruled that foreign evidence that might have been obtained under torture cannot be used against terror suspects.
Responding to appeals by eight terror suspects, they ruled that torture should always be condemned and to allow it to be part of the British justice system would bring that system into disrepute.
They put the responsibility on the Special Immigration Appeals Commission (SIAC), which hears terrorism cases, to decide which evidence falls into this category.
However, there was disagreement about how it should do this - whether the evidence that torture was used should be confirmed as obtained under torture, or simply under question.
Today's unanimous decision by seven members of Britain's highest court of appeal is likely to lead to a review of previous cases brought against people suspected of terrorism.
Home secretary Charles Clarke has said he accepts the ruling, and expressed his belief that it would have "not affect" on the government's efforts to tackle terrorism.
And human rights group Liberty said it was an "incredibly important ruling" that sent a clear message that there would be no compromise on torture.
Ministers have always insisted that foreign evidence is not used where they know or believe it was obtained through torture, while the use of any evidence obtained through torture by British security forces is expressly forbidden in law.
However, the question of whether torture evidence from abroad could be used in court is not set in law, and last year the Court of Appeal ruled that third party evidence obtained under torture could be used in the SIAC.
The government argues the home secretary sometimes has to rely on intelligence of dubious source in the interests of national security, such as arresting someone whom intelligence suggested was going to carry out a terrorist attack.
As the use of such evidence was necessary in this case, there must be provisions for it to be used when bringing terror suspects to court, otherwise the home secretary would be unable to justify his actions.
Today's ruling, which comes after an appeal by eight terror suspects, accepts that the home secretary must be able to use potentially suspect intelligence to take action against terrorism, but argues that bringing such evidence into the judicial process would be unacceptable.
"Torture is an unqualified evil. It can never be justified," said Lord Brown of Eaton-under-Heywood, one of the law lords.
And he said that the SIAC could never property uphold an action where the sole or decisive evidence supporting it was based on torture, adding: "To hold otherwise, would bring British justice into disrepute."
There was unanimous agreement that it must not be up to terror suspects to prove the evidence against them was obtained under torture - this would be impossible, given that, under SIAC rules, they do not see the evidence or know its origins.
But the question of how the SIAC would discover this was a matter of dispute, with some law lords arguing that even the possibility of evidence being obtained under torture should lead to it being thrown out of court.
However, the majority agreed that the decision should be made on the balance of probabilities - a stance welcomed by Mr Clarke.
"We have always made clear that we do not intend to rely on or present evidence in SIAC, which we know or believe to have been obtained by torture. So this issue is hypothetical," he said.
"The real issue is the test applied. We do not expect this test to affect the outcome of these individual appeals.
"As Lord Hope said in his judgment today: 'It is one thing to condemn torture, as we all do. It is another to find a solution to the question that this case raises which occupies the moral high ground but at the same time serves the public interest and is practicable.
"Condemnation is easy. Finding a solution to the question is much more difficult.'"