NEW YORK/WASHINGTON (Reuters) - A U.S. judge has blocked the Trump administration from separating immigrant parents and children at the U.S.-Mexico border, and ordered that those who were separated be reunited within 30 days.

The nationwide injunction issued late Tuesday by U.S. District Judge Dana Sabraw in San Diego will not be the final word on a heated battle over the treatment of immigrant families who cross the border illegally. A government appeal is likely.

Sabraw’s preliminary injunction also requires the government to reunite children under the age of five with their parents within 14 days, and let children talk with their parents within 10 days.

More than 2,300 migrant children were separated from their parents as a result of the administration’s “zero tolerance” policy that began in early May and sought to prosecute all adults crossing the border without authorization, including those traveling with children.

The separations sparked widespread condemnation in the United States, including from within President Donald Trump’s own Republican Party, and abroad.

Although Trump issued an executive order on June 20 to end the family separations, the American Civil Liberties Union, which brought the San Diego case, said it contained “loopholes” and did little to fix the problem. Some 2,000 children remain separated.

Sabraw, an appointee of former Republican President George W. Bush, rebuked the administration.

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

The White House had no immediate comment.

Slideshow ( 16 images )

LAYING BLAME

In opposing a preliminary injunction, the government had argued that Trump’s executive order “largely” addressed the concerns of the ACLU.

Health and Human Services Secretary Alex Azar told a Senate hearing earlier on Tuesday that most separated children could not be reunited until the Republican-led Congress passed necessary legislation.

He also laid blame for the problem on the families, saying that “if the parents didn’t bring them across illegally, this would never happen.”

The ACLU hailed Sabraw’s decision.

“This victory will be bring relief to all the parents and children who thought they may never see each other again,” ACLU lawyer Lee Gelernt said in an email. “It is a complete victory.”

Sabraw ruled several hours after 17 generally Democratic-leaning states and Washington, D.C. sued the Trump administration in Seattle federal court over the family separations, calling them “cruel” and motivated by “animus.”

Slideshow ( 16 images )

LEGISLATIVE SOLUTION

After issuing his executive order, Trump called last week on Congress to pass legislation that addressed immigration issues. But although Republicans control Congress, disagreements between moderates and conservatives in the party have impeded a speedy legislative fix to the border crisis.

An immigration bill favored by conservative Republicans failed to pass the House last week. The House planned to vote on Wednesday on a broad immigration bill that would bar the separation of children from their parents at the southern border

In a Twitter post written in capital letters throughout, Trump said House Republicans should pass the bill, even though he said Democrats would stop it from passing in the Senate, where Republicans have a slimmer majority.

“PASSAGE WILL SHOW THAT WE WANT STRONG BORDERS & SECURITY WHILE THE DEMS WANT OPEN BORDERS = CRIME,” the president wrote on Twitter.

House Speaker Paul Ryan said on Tuesday he would not rule out the possibility of bringing a vote on a narrower bill addressing only the detention of immigrant families, if the broader bill did not pass.

The ACLU had sued on behalf of a mother and her then 6-year-old daughter, who were separated for four months after entering the country to seek asylum and flee religious persecution in Democratic Republic of Congo.

The ACLU case is Ms. L et al v U.S. Immigration and Customs Enforcement et al, U.S. District Court, Southern District of California, No. 18-00428.