The U.S. government is expected to appeal a federal court ruling ordering the immediate release of undocumented mothers and immigrant children from family detention centers.

U.S. District Judge Dolly Gee in Los Angeles issued the decision on Friday, reaffirming an earlier July ruling that barred the U.S. from detaining some minors who crossed the border illegally according to a long-standing settlement.

Under the ruling, the Obama administration has until Oct. 23 to release hundreds of unauthorized immigrant children and, in certain cases, their mothers "without unnecessary delay," reports Reuters.

According to Judge Gee, the Department of Homeland Security cannot legally detain undocumented children under 18 years old at the centers for over 72 hours due to the standards set out in the 1997 Flores v. Meese settlement. The judge also described conditions at the centers as "deplorable" in her ruling, reports the Los Angeles Times.

On the other hand, lawyers representing the Justice Department argued that the judge should not implement her decision since there have been recent improvements at the centers, which are now being transformed into short-term processing facilities.

The Obama administration also argued that limiting detention any further "would heighten the risk of another surge in illegal migration ... by incentivizing adults to bring children with them on their dangerous journey as a means to avoid detention and gain access to the interior of the United States," reported The Associated Press. Furthermore, the government also says that brief detentions no longer violate legal agreements stipulating that immigrant children not be held in secure facilities.

Meanwhile, immigrant advocates have filed complaints and lawsuits against the centers, while more than 170 House Democrats have also demanded that the centers be shut down.

"It's disappointing that the administration continues to push to jail women and children seeking asylum," said Democratic Rep. Zoe Lofgren.

"The writing is on the wall - family detention is unacceptable, un-American, and will end. Rather than fight the court's ruling, the right and moral response is to swiftly take the necessary steps to bring our nation's detention policy in line with the Flores settlement agreement," she added.