A federal judge on Tuesday (June 26) ruled that the Trump administration must stop its family separation policy at the border and ordered the more than 2,300 children already separated to be reunited with their parents.

United States District Court Judge Dana M. Sabraw granted the American Civil Liberties Union a preliminary injunction in a lawsuit the organization filed challenging family separations. He ordered the federal government to reunite parents with their children within 30 days. Children age 5 and under must be reunited within 14 days, Sabraw ruled.

Sabraw agreed with the ACLU’s assertion that the Trump administration was not prepared to accommodate the rush of separated children in the wake of the “zero tolerance” immigration policy unveiled in early May. He said the situation “has reached a crisis level.”

“The facts set forth before the court portray reactive governance—responses to address a chaotic circumstance of the government’s own making,” Sabraw wrote in the order for Ms. L v. ICE. “They belie measured and ordered governance, which is central to the concept of due process enshrined in our Constitution.”

Beyond halting separations and ordering reunifications, Sabraw also ruled that the Trump administration must take every step to facilitate communication between parents and children in custody of the Department of Health and Human ServicesOffice of Refugee Resettlement. He gave federal officials 10 days to provide telephone communication between parents and children if contact has not already been established. 

“This ruling is an enormous victory for parents and children who thought they may never see each other again,” Lee Gelernt, deputy director of the Immigrants’ Rights Project at the ACLU, said in a statement. “Tears will be flowing in detention centers across the country when the families learn they will be reunited.”

The ACLU filed the lawsuit in February on behalf of a Congolese mother seeking asylum. Upon entering the U.S., she was detained in San Diego, while her 7-year-old daughter was flown to a detention center in Chicago.

Sabraw’s ruling represents a blow to President Donald Trump, who has heartily defended family separations as an migration deterrent and has falsely blamed Democrats for the policy. Trump’s justifications have been echoed by Attorney General Jeff Sessions, who has defended family separations by pointing to a passage from the Bible.

That defense has received widespread condemnation, at home and abroad, with bipartisan opposition to zero tolerance policies emanating from Washington D.C. and international denunciations from organizations like the United Nations.

In response to fervent criticism, Trump last week signed an executive order ostensibly ending family separations. And the Department of Homeland Security later issued a fact sheet detailing its efforts to reunite families, a process immigrant rights attorneys depicted as chaotic.

Earlier on Tuesday, in a separate lawsuit, 17 states sued the Trump administration in an effort to reunite migrant families separated at the U.S.-Mexico border. Blasting the policy as “cruel” and “unlawful,” the suit says the Trump administration’s policy is motivated by “animus” toward immigrants from Latin America.

“The administration’s practice of separating families is cruel, plain and simple,” New Jersey Attorney General Gurbir Grewal said in a statement. “Every day, it seems like the administration is issuing new, contradictory policies and relying on new, contradictory justifications. But we can’t forget: the lives of real people hang in the balance.”