A family from Cameroon who were facing deportation have won the right to damages against the government for unlawful imprisonment and compensation for violation of their human rights.
Frederick Nukajam, his partner Sandra and their three young children were detained at Yarl's Wood immigration removal centre in Bedfordshire for three weeks in November 2008.
The children were then three-year-old twins and a six-month-old baby.
Lawyers in the case were given 56 days yesterday to reach agreement on the level of damages for the family, who are living in Stoke-on-Trent.
A judge also ordered the Home Secretary to pay legal costs on an indemnity basis, the highest possible level.
The judge made the rare order because of the "woeful procedural ineptitude" shown by the UK Border Agency (UKBA), which is responsible for controlling migration in Britain, in dealing with the case.
Deputy High Court Judge David Elvin QC said that the reasons for continuing the detention of the family were bad and based on a misunderstanding of the facts.
When legal action started and there was a better understanding, the UKBA did little if anything to investigate further or instruct government lawyers "until a very late stage," he added.
He went on to say: "While this form of delay and procedural ineptitude is all too frequent in this area of the law and may be understandable up to a point - though not necessarily excusable - it is a particular cause for concern and criticism in circumstances which involve the detention of young children."
He ruled that the claimant's article 5 human rights had been breached and he was entitled to a declaration to that effect.