The government made the payments to 40 former teenage detainees between 2009 and 2010 after acknowledging it had been wrong to keep them in custody.

LONDON — The British government has paid out roughly $1.6 million in compensation to dozens of child asylum seekers wrongly held in detention centers before 2005, lawyers said Saturday.

London law firm Bhatt Murphy said in a statement that the government made the payments to 40 former teenage detainees between 2009 and 2010 after the government acknowledged it had been wrong to keep them in custody.

Bhatt Murphy said that nonspecialist-immigration officials had incorrectly classified the teens as adults “purely on the basis of their appearance,” forcing them to prove that they were underage. The government’s age-verification procedures have since been reformed.

Immigrants’ rights groups have long campaigned against the British practice of holding hundreds of child asylum seekers in immigration-detention centers for weeks or longer, calling it inhuman.

In 2010 British Deputy Prime Minister Nick Clegg vowed to put a stop to it, but a small number of children are still kept in custody, generally for much shorter periods of time.

Britain’s Border Agency said Saturday that it takes the welfare of young people seriously.

The Guardian newspaper said that children came from Afghanistan, Iran, Sri Lanka, Nigeria, Eritrea, Uganda, Somalia and China. The newspaper says 25 of the children were aged 14 to 16. The paper quoted two of them as saying they’d been traumatized by their experiences.