LOS ANGELES (CN) – A federal judge in Los Angeles on Monday blocked the Trump Administration efforts to roll back a settlement agreement that limits the time the government can hold immigrant children separated from their families at the border.

U.S District Judge Dolly Gee issued an order denying the federal government’s ex parte application to dismantle key provisions of the Flores Settlement agreement, saying it was “procedurally improper and wholly without merit.”

Gee called government’s motion “cynical” and said they sought to “light a match” to the Flores settlement.

Her order said a “tortured interpretation” of the Flores agreement was used in attempting to indefinitely detain “blameless” migrant children whose safety “should be paramount.”

Gee said the federal government was trying to “shift responsibility to the Judiciary” after over 20 years of legislative inaction on immigration “and ill-considered Executive action that have led to the current stalemate.”

The Flores settlement, an agreement in the California case Flores v. Reno, set national standards for the detention, release and treatment of all undocumented children in federal custody.

Migrant children are to be released to relatives or other custodians or placed in facilities within five days or up to 20 days, according to the settlement, and facilities must be “the least restrictive setting appropriate to the minor’s age and special needs.”

President Donald Trump signed an executive order on June 20 ending his administration’s policy of separating immigrant children from migrant families at the U.S.-Mexico border.

As part of the order, the Justice Department asked Judge Gee to modify the Flores settlement agreement, arguing that the settlement limited their ability to execute Trump’s order and reunite children with parents in detention while awaiting legal proceedings.

The DOJ’s filing said the Flores settlement created a “powerful incentive for aliens to enter this country with children” by eliminating the “practical availability of family detention across the nation.”

The agency blamed the Flores agreement for a “3- to 5-fold increase in the number of unauthorized family border crossings.”

Gee said the government’s claim that the Flores settlement caused a spike in border crossings “unconvincing.”

“Any number of other factors could have caused the increase in illegal border crossings, including civil strife, economic degradation, and fear of death in the migrants’ home countries,” Gee wrote in the order.

On June 26, U.S. District Judge Dana Sabraw in San Diego ordered the government to reunite children under five years old with their parents within five days, while older children were to be returned to their parents within 30 days.

DOJ attorneys argued that in order to comply with Sabraw’s order, the government could no longer release detained migrant children as required under the Flores settlement.

Gee called the attorney’s argument a “strained construction” of the Flores settlement.

“Absolutely nothing prevents Defendants from reconsidering their current blanket policy of family detention and reinstating prosecutorial discretion,” the order said.

In a statement, Justice Department spokesman Devin O’Malley said, “The Trump Administration continues to make good faith efforts that allow us to not only enforce the law, address the crisis of illegal immigration our border, and protect our nation and its citizens, but also protect the safety of children in government care and custody.

O’Malley continued: “We disagree with the court’s ruling declining to amend the Flores Agreement to recognize the current crisis of families making the dangerous and unlawful journey across our southern border, but the court does appear to acknowledge that parents who cross the border will not be released and must choose between remaining in family custody with their children pending immigration proceedings or requesting separation from their children so the child may be placed with a sponsor. The Justice Department continues to review the ruling.”