Judge Andrew Napolitano said Wednesday the federal government "has failed miserably" to comply with a court decision which states that children should be released after apprehension at the U.S. border.

Napolitano explained that under a 1997 Supreme Court decision in Flores v. Reno, the government is required to release children from immigration detention "without unnecessary delay" to the "least restrictive setting," meaning a parent or an adult relative.

"The government has failed miserably to comply with those basic guidelines," he said on "Outnumbered." 

Trump: 'Fake News Media' Helping Smugglers & Traffickers 'Like Nobody Would Believe'

Gonzales: President, Congress Are Elected to 'Solve Difficult Issues' Like Immigration

The court case, Napolitano noted, stemmed from a lawsuit over the conditions under which young migrants were being held during the Clinton administration. 

President Trump said earlier that he would take executive action to avoid the migrant family separations at the border, which have caused national outrage.

The Fox News senior judicial analyst said he hopes Trump's executive order gives the Department of Homeland Security the power to evaluate cases on an individual basis, rather than a "one size fits all" approach. 

Watch the discussion above. 

'Do Your Job, Fix the System': ICE Director Hits Back at Gillibrand for Calling Trump Admin 'Evil'

'He Was Not Elected to Commit Child Abuse': NY Dem, Pelosi Blast Trump for Migrant Family Separations

Schlapp: Dems Using Immigration as 'Emotional, Divisive, Political Play' Ahead of Midterms