Control orders severely restrict freedoms of suspects
The Law Lords have ordered the government to reconsider control orders imposed on eight terrorism suspects.
But they did not declare the controversial anti-terrorism measure to be completely unlawful.
In rulings on six individuals, the Lords said control orders which included 18-hour curfews, restricting someone to their homes, were too long.
The Lords ordered the courts to rethink two other cases because the proceedings had breached a right to a fair hearing.
Under the control order system, the Home Office can impose daily curfews, restrictions on whom a subject can meet and where they are allowed to go.
Subjects must also report daily to police and are banned from using mobile phones, email or the internet.
Ministers say the system is necessary for people where there is intelligence they are involved in terrorism - but not enough evidence for a prosecution.
In the key challenge of four before the Lords, six Iraqi men, two of whom later absconded, had argued 18-hour home curfews had breached their fundamental right to liberty.
WHAT THE LAW LORDS SAID
18-hour curfews: Unfair
Some evidence procedures: Unfair
Shorter curfews: legal
Wider regime: legal
Three of the five Lords agreed and said the home secretary should only be able to order shorter curfews.
The ruling has no practical effect on the subjects because the home secretary had already issued less restrictive curfews.
But in a crucial victory for the government, all five Law Lords agreed the regime did not amount to a criminal punishment - and therefore did not need to abide by ordinary court procedures.
Lord Bingham, the lead Law Lord issuing opinions, said he agreed two of the control orders had a devastating effect on the subjects and their families.
THE KEY CASES
MB: British man in South Yorkshire
JJ and others: Iraqis
In the case of MB, a Kuwaiti-born British national, and AF, a UK-Libyan, Lord Bingham said claims that they had been denied a fair trial were credible.
"I have difficulty in accepting that MB has enjoyed a substantial measure of procedural justice, or that the very essence of the right to fair hearing has not been impaired," said the Lord.
"The right to a fair hearing is fundamental. In the absence of derogation [opting out of human rights law] it must be protected. It seems to me that it was not."
However, stopping short of ruling the system incompatible with human rights, he said the cases needed to be referred back to the courts for a rethink.
The lords dismissed the ninth appeal of a Tunisian man known only as E.
Home Secretary Jacqui Smith said she welcomed the broad thrust of the rulings.
She said that control orders were not the "first choice" to deal with terrorism suspects - but there were cases where it was appropriate.
"I'm very pleased that the Law Lords have upheld the regime," she told the BBC. "My top priority is national security and protection of the British people."
Ms Smith said she was disappointed that 18-hour curfews had been ruled out, but added no order would have to be "weakened" because of the rulings.
But Shami Chakrabarti, of human rights group Liberty which was involved in the cases, said the judgements did not solve fundamental problems with the system.
"These decisions will cause few celebrations at Liberty or the Home Office, and fully satisfy neither fairness nor security," said Ms Chakrabarti.
"The authorities have rightly lost their most draconian 18-hour curfews without trial. Whilst that is a body blow to Blairite policy, it is now left to the Strasbourg Court or Westminster to restore the age-old right to a fair trial."
Shadow Home Secretary David Davis called for a review of control orders, saying ministers had been warned of inevitable challenges.
"They failed to heed that warning and today's judgment is the unfortunate, but predictable, consequence," he said.
Nick Clegg, for the Liberal Democrats, said the ruling represented a "further unravelling of a system which is wrong in principle and flawed in practice".