Vulnerable children in Scotland may have been detained unlawfully in secure accommodation, an investigation by the Scottish Children and Young People’s Commissioner has found.

The commissioner’s investigation concluded that councils may have breached the law by locking up at-risk children in secure accommodation, unable to leave, purportedly to protect them and others.

He examined cases of 118 children placed in secure accommodation across 27 local authority areas between August 2018 and July 2019.

READ MORE: Free school meals in Scotland to be expanded to 90,000 additional children

The research found youngsters were detained for between 14 and 572 days and a significant number may have been unlawfully held for at least part of their detention, sometimes without consulting them.

Bruce Adamson, the Children and Young People’s Commissioner Scotland, suggested there was minimal communication about why they had been detained and they may have not been told about their right to appeal.

Mr Adamson said: “Taking away a child’s liberty is one of the most serious restrictions a state can impose on children’s human rights.

“It has deep and long-lasting consequences, particularly on a child’s emotional and social development.

“Human rights law is clear that the detention of a child must be within the law and be only used as measure of last resort and for the shortest appropriate period of time.”

He is now calling for councils to urgently ensure they are complying with the law and the European Convention of Human Rights, as well as a Scottish Government review of the legal framework and how the practice of detaining is compatible with the United Nations Convention on the Rights of the Child.

Nick Hobbs, the commission’s head of advice and investigations, said: “Secure accommodation should be reserved for those whose needs cannot be met in any other environment or place of safety.

“Decisions with such severe consequences are not taken lightly but we have found that in some cases they are being made without due process of law, which is in breach of children’s human rights.

READ MORE: Ministers tell teachers to watch for state Covid message critics to curb pupil radicalisation

“It is critical that these children understand what is happening to them, that they are a key part of decisions that can impact the rest of their lives and that they are told about their right of appeal.”

Mr Hobbs added: “Children in secure care are some of the most vulnerable in Scotland.

“Local authorities in Scotland must urgently review their practice to ensure that they are acting within the law.

“These legal duties are critical to ensuring that every part of the process designed to protect them has their rights, views and experiences at its heart.”