The Home Office has paid compensation of more than £1m, plus £1m costs, in a case involving 40 child asylum seekers who were wrongly detained as adults, it has been reported.
It is thought to be the first case of its kind and the largest immigration detention payout for a single case, according to the Guardian.
Government officials accepted that the policy was unlawful and changed it as a result of this case, the newspaper said.
However, data showed children were still being detained, it added.
The case that resulted in the payout involved girls and boys, including 25 aged 14 to 16, from countries including Afghanistan, Iran, Sri Lanka, Nigeria, Eritrea, Uganda, Somalia and China, the newspaper said.
The youngest was a 14-year-old girl from Sri Lanka. Some were survivors of torture in their home countries and some of the girls were survivors of rape and other forms of sexual violence, it added.
Some of the 40 had been assessed by social services and declared to be children, it said.
A UK Border Agency spokesman said: "We take the welfare of young people exceptionally seriously.
"Where there is any doubt over an individual's age, they will not be detained unless an independent local authority age assessment concludes that they are over 18. These checks are carried out by social workers with expert knowledge.
"All of our front-line staff receive specialist training to ensure that the welfare of young people is considered at every stage."
Donna Covey, chief executive of the Refugee Council, said: "The Government pledged to end child detention nearly two years ago, and while they have made steps to do this for children with their families, children who are here on their own, many having fled horrifying experiences in their own countries, are still being detained due to flaws in the system. This is unacceptable.
"We know from our work with detained young people that detention can severely damage their physical and mental wellbeing.
"There must be better guidance and training for people working on age assessments, and these should be done independently. Most importantly, these young people must be given the benefit of the doubt."