(CNN) A federal judge in California blocked the Trump administration's proposal to detain undocumented families together indefinitely.

At issue was what is known as the Flores settlement that requires the government to release a minor from a non-licensed facility as expeditiously as possible, which has been set at 20 days. The administration has wanted to scrap the 20-day limit.

"The blessing or the curse -- depending on one's vantage point -- of a binding contract is its certitude. The Flores Agreement is a binding contract and a consent decree," US District Judge Dolly Gee said in her ruling. "Defendants cannot simply ignore the dictates of the consent decree merely because they no longer agree with its approach as a matter of policy."

Gee shared a tentative ruling with plaintiffs and defendants that provided a window into her decision prior to Friday's hearing.

"There wasn't a whole lot to be discussed given her conviction that the final regulations were inconsistent with the settlement agreement," said Neha Desai, co-counsel for Flores and director of immigration at the National Center for Youth Law.

Read More