The law lords have ruled that prisoners who received indeterminate sentences for public protection (IPPs) under the Criminal Justice Act 2003 should not be released unless they can show that they would no longer present a risk to the public.
The House of Lords was ruling in Secretary of State for Justice v James (formerly Walker) and R (on the application of Lee) v Secretary of State for Justice and one other action  UKHL 22.
Delivering judgment, Lord Brown described IPPs, introduced in April 2005, as a ?new form of mandatory life sentence? for those convicted of up 153 violent or sexual offences, and considered to present a serious risk of harm to members of the public if released.
He said the prison system was ?rapidly swamped? with IPP offenders, many with comparatively short tariffs.
He said there were ?neither the systems nor resources? available, particularly for short-term prisoners, to identify the risk factors or provide the courses to enable them to demonstrate their safety for release, ?let alone treat and correct their offending behaviour?.
Erica Restall, solicitor at Switalskis in Bradford, acted for Brett James. Although he was the only one of the three to be released, she said she was very disappointed by the ruling.
?The House of Lords clearly recognised that there was a failure by the secretary of state to put in place resources, but they could not offer a remedy,? she said.
?There are a lot of people in prison who do not know when courses will be available to them.?
Restall said the law lords had offered the possibility of judicial review in individual cases but had set the threshold very high.
Alternatively she said an application could be made to the European Court of Human Rights.
Lord Brown said he wanted to register ?real disquiet? about the way IPPs were introduced and said it was ?most regrettable? that the justice secretary admitted being in breach of his public law duty with regard to them.
?The maxim ?marry in haste, repent at leisure? can equally well be applied to criminal justice legislation, the consequences of ill-considered action in this field being certainly no less disastrous,? he said.
?It is much to be hoped that lessons will have been learned.?
Lord Brown said that to release the post-tariff prisoners on the grounds that they were unlawfully detained would breach s.28 of the Crime (Sentences) Act 1997, which provided that a life prisoner who has served the tariff period should not be released unless the Parole Board was satisfied it was no longer necessary for public protection.
?The remedy for such breach of public law duty - indeed the only remedy, inadequate though in certain respects it may be - is declaratory relief condemning the secretary of state?s failures and indicating that he is obliged to do more.
Lord Brown held that continued detention of the post-tariff prisoners did not breach Article 5(1) of the Convention (right to liberty) or Article 5(4) (challenging detention). He dismissed the men?s appeals.
Lords Judge, Hope, Carswell and Mance agreed