21/12/2016 12:09 PM AEDT | Updated 21/12/2016 6:29 PM AEDT

Victorian Supreme Court Rules Jailing Children In Adult Prisons Is Illegal

'All persons deprived of liberty must be treated with humanity.'

Premier Daniel Andrews vowed earlier this month to keep the teenagers in an adult prison.

A key component of Victorian Premier Daniel Andrew's youth crime solution has been thrown into disarray after the Supreme Court ruled jailing children in adult prisons is illegal.

But the state government is arguing there is nowhere else for them to go.

Supreme Court Justice Gregory Garde initially ruled on Wednesday that 20 children being held at Barwon Prison must be removed by 4pm on Thursday and transferred to another remand centre. However, after hours of deliberations, Justice Garde conceded that they would have to stay for now, as there were no "secure" beds available in any of the state's juvenile detention centres.

Justice Garde said the children's human rights had been breached, and they were illegally being held at the maximum security prison.

The Agereports the court had previously heard the boys being held at Barwon -- all of whom have yet to be sentenced and may yet be found not guilty -- had been held in isolation in their cells for up to 23 hours a day.

They had also been denied access to education and other programs available to them at other youth justice facilities, and had been denied full access to their families and their lawyers, the court heard.

The Victorian Government has indicated it will appeal the decision.

In early December, Andrews vowed to fight to keep teenagers in adult prison. A week before the declaration, Andrews reportedly backed out of a different legal battle and returned several Indigenous teenagers to youth justice centres.

Following a series of riots at the Parkville youth justice centre in November, the Victorian government began transferring children from three youth justice centres to the maximum security Barwon Prison.

It's been reported that the riots caused $2 million worth of damage and more than 60 beds were destroyed.