He is the latest in a series of judges to raise concern about a shortage of secure accommodation places for teenagers in England and Wales.

The most senior family court judge in England and Wales raised concern more than a year ago.

Sir James Munby, President of the Family Division of the High Court, said in October 2016 that the problem had led to social services bosses at English councils trying to place children in secure accommodation units in Scotland.

Mr Justice Francis said the girl he was dealing with was a “very troubled young woman” who had self-harmed.

The judge said everyone involved agreed that she needed to be in secure accommodation – but no suitable unit could be found.

He said she was currently being housed in an unsuitable residential unit.

“It is the duty of the Government to provide secure accommodation for teenagers such as (this girl),” said Mr Justice Francis.

“It seems to me that duty has been compromised.”

The judge said he would next analyse the case at a hearing in Cardiff on March 5. He said if no suitable unit had been found by then he wanted Mr Hinds, or a representative, to appear at that hearing and explain why.

He added: “If central government assumes responsibility to look after young people such as (this girl) then it must discharge that duty.”

The judge said a failure to provide secure accommodation units added to the burdens placed on staff looking after teenagers and cost councils money.