The 15-year-old asylum seeker was held at Oakington
A 15-year-old Afghan asylum seeker has been awarded £11,000 in compensation after the government conceded he had been "detained unlawfully".
Home Secretary Charles Clarke conceded that the boy should not have been held at Oakington reception centre, near Cambridge, in June last year.
The High Court on Tuesday was also told the boy can now stay in the UK at least until his 18th birthday.
The Home Secretary's legal team also agreed to pay the boy's legal cost.
The £11,000 will be invested in a fund for the destitute 15-year-old Afghan, referred to as "A" for legal reasons, and the proceeds will be handed over to him when he reaches the age of 18.
It was a dispute over the age of the boy, from the Nangarghar province of Afghanistan, which led to him being held at Oakington detention centre near Cambridge for 12 days.
He arrived in the UK on his own on 2 June last year and immediately claimed asylum.
The teenager said he was 14 and gave his date of birth as 1 January 1990, but the immigration authorities disputed his age and refused to release him from Oakington until 13 June when forced to do so by a court order.
The Refugee Legal Centre (RLC), a publicly-funded charity which provides legal services to immigrants and asylum seekers, wrote to the then Home Secretary David Blunkett saying A should never have been detained in the first place.
It was "a clear breach" of the Home Secretary's own publicly-stated policy governing the detention of unaccompanied minors seeking asylum.
In borderline cases, the young asylum seeker is to be given the benefit of the doubt and dealt with as a minor.
Following the refusal to order A's immediate release, the RLC sought damages against the Home Secretary, arguing that the boy's appearance did not strongly suggest he was over 18, and he should have been given the benefit of the doubt.
The case for damages was due to be heard by Mr Justice Wilkie at the High Court in London on Wednesday.
But a hearing became unnecessary when the current Home Secretary conceded that A had been detained unlawfully from 2 to 13 June last year.