On Monday, U.S. District Judge Dolly Gee rejected President Donald Trump‘s administration efforts to detain immigrant families for long terms.

The Department of Justice asked Gee to alter the Flores Agreement, a 1997 settlement which provides the framework for how to handle detained immigrant children, so it could detain families together for longer periods. The Trump Administration said Gee’s previous rulings had made family detention unlikely and provided an incentive for a surge of immigrants to bring children across the border illegally with the expectation they wouldn’t be locked up. According to The New York Times, Gee called the administration’s request “a cynical attempt” to shift responsibility to the court “for over 20 years of Congressional inaction and ill-considered executive action that have led to the current stalemate.”

Gee said the application to change the Flores agreement — named for an El Salvador immigrant who was 15 when the case was brought in 1985 — was “procedurally improper and wholly without merit.”

The Department of Justice did not say if it would appeal. Spokesman Devon O’Malley said in a statement, “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.”

Attorney Peter Schey, who represents detained children in the settlement, told The Times, “Sifting through the government’s false narrative, the court clearly found that the Flores settlement has never resulted in the separation of families.” Schey added, “President Trump needs to take responsibility for his own misguided policies.”

SLIDESHOW: DONALD TRUMP’S 30 CRAZIEST TWEETS

Trump now faces the same dilemma that President Barack Obama’s administration confronted when Central American migrants began surging across the southwest border. Three years ago, Gee rejected a similar effort by the Obama administration and ruled at the time that immigrant children generally can’t be held longer than 20 days.