Last night, a federal judge in California issued an injunction blocking the Trump administration from continuing with its policy of separating children from their parents at the border. The ruling also requires the administration to reunite all previously separated children and parents under a tight time frame.

What’s remarkable about this ruling is how scathing a rebuke of the Trump administration’s cruelty, inhumanity and incompetence it delivers. What’s more, for reasons noted below, it could also prevent President Trump’s cruelty, inhumanity and incompetence from hurting more children going forward.

The ruling from U.S. District Judge Dana Sabraw enjoins the government from detaining people separate from their minor children, absent evidence that the parents pose a threat to them, and requires the government to reunite all separated children under 5 years old with their parents in 14 days, and all children over 5 in 30 days.

The Trump administration had launched a “zero tolerance” policy of prosecuting all people who cross the border illegally, including asylum seekers, which produced a sharp rise in family separations, as children must be separated from parents undergoing criminal prosecution. The ruling came in response to a lawsuit by the American Civil Liberties Union. Trump has since issued an executive order ending the family separations while vowing to continue holding families and children together indefinitely in immigration detention (as opposed to criminal prosecution).

To get an injunction, plaintiffs must show (among other things) that they will suffer irreparable harm without one and that their underlying legal claim is likely to succeed on the merits. The ruling grants both of these and goes into detail about the policy’s cruel and incompetent execution. It details evidence that for children, separations can be a “highly destabilizing, traumatic experience.” And, remarkably, it notes that legal arguments confirmed that the government apparently had no workable procedure in place for reuniting children with parents once they are released, resulting in some being “orphaned”:

The practice of separating these families was implemented without any effective system or procedure for … tracking the children after they were separated from their parents … and reuniting the parents and children after the parents are returned to immigration custody following the completion of their criminal sentence. This is a startling reality. The government readily keeps track of personal property of detainees … under the present system migrant children are not accounted for with the same efficiency and accuracy as property.

The ruling concludes that in part because the separations pass a judicial standard in which they “shock the conscience,” the lawsuit is likely to succeed on the merits of its underlying claim, which is that the policy violates constitutional due process rights.

This scathing ruling has direct bearing on what’s next, in two ways. First, it will block the administration from resuming separations if it wants to. The Trump administration now wants to hold parents and children indefinitely in noncriminal detention — as opposed to criminally prosecuting the parents — but that might run afoul of the 1997 Flores settlement, which requires children to be released in 20 days. The administration has asked the courts to amend it, but that’s unlikely.

Some immigration advocates fear that Trump doesn’t expect Flores to be changed and that this will give him a pretext to balk at releasing immigrant families into the United States while awaiting hearings — what he derisively calls “catch and release” — and then to return to full-blown criminal prosecutions and family separations. But immigration attorney David Leopold tells me that the ruling “effectively blocks Trump from restarting his despicable family separation scheme again.”

Second, the big question now is how successful the administration will be in actually reuniting these families, with the number of separated children numbering more than 2,000. Lee Gelernt, the ACLU attorney working on this case, tells me: “It was clear the Administration had no plan to reunify these children, so the Court set hard deadlines to force the government to mobilize its resources and finally prioritize getting these children back to their parents.”

This now requires the administration to actively bring the resources of the federal government to bear on cleaning up the monstrous moral and humanitarian catastrophe it has unleashed, rather than handing a few phone numbers to parents looking for their kids and effectively telling them, “Good luck!”

Trump’s power is not absolute — for now

The bigger story here is that Trump is trying to use the broad immigration enforcement discretion presidents enjoy to enforce an agenda that is rooted in open bigotry (the Muslim ban) and motivated cruelty, which is at the core of family separations. The explicitly stated purpose of the “zero tolerance” policy is to produce more family separations precisely because the prospect of enduring them — and, by extension, the extreme fear, anxiety and suffering they threaten to induce — might dissuade more people from trying to cross the border, including people fleeing other horrors at home.

The Supreme Court yesterday upheld the Muslim ban, ruling that despite Trump’s repeated, open declarations that the ban is motivated by a desire to keep out Muslims, that doesn’t have any bearing on Trump’s authority to carry out what the court called a “neutral” directive that “says nothing about religion.” But — for now, anyway — Trump’s power does not extend to the authority to ramp up family separations for the purpose of keeping away would-be border-crossers, desperate refugees included.

* A SHOCKING UPSET: Last night, Alexandria Ocasio-Cortez, a 28-year-old Latina, beat Democratic Rep. Joseph Crowley, who might have become House speaker one day, in New York’s 14th District:

Ocasio-Cortez’s politics are substantially to the left of most of the party … In her campaign videos and posters, designed by friends from New York’s socialist circles, she came out for the abolition of ICE, universal Medicare, a federal jobs guarantee and free college tuition. The ads also made it clear that she was a different candidate — a young Latina from the Bronx, not a white man from Queens.

Republicans are already gearing up to paint her as a socialist to tar other Democratic House candidates, but, you know, good luck with that.

* VOTERS WANT A CHECK ON TRUMP: New NBC News-Marist polling finds that in three key battleground states, majorities or pluralities want more Democrats in Congress to function as a check on Trump:

In Arizona, 52 percent of registered voters say they’ll use their vote to send a message that the country needs more Democrats to serve as a check on Trump … In Florida … 49 percent of voters favor a Congress that serves as a check … And in Ohio, 51 percent want more Democrats in Congress in order to counter Trump’s efforts.

In Arizona and Ohio — where there are two big Senate races — the percentages of voters who want a Congress that helps pass Trump’s agenda are in the mid-30s. Winning!

* A COLORADO RACE TO WATCH: Democrats last night nominated Jason Crow, a favorite of party leaders, in Colorado’s 6th District:

He will face endangered Rep. Mike Coffman, a moderate Republican trying to broker an immigration compromise who has expressed frustration with Trump.

This race is a Toss Up, and it will demonstrate whether Republicans in more diverse districts can dispel the Trump curse by trying to get the party to be less crazy on immigration.

* A KENTUCKY RACE TO WATCH: National Journal profiles the “bellwether” race unfolding in Kentucky’s 6th District between GOP Rep. Andy Barr and Democratic challenger Amy McGrath, a former fighter pilot and rising political star:

The state’s Democratic base of Lexington represents about 40 percent of the district’s voters, but its GOP-friendly rural surrounding counties make up a majority of the electorate. … If McGrath scores an … upset, it will be a very encouraging sign for the Democrats’ prospects for a House majority. A McGrath victory would indicate that Democrats are capable of winning back blue-collar Trump voters and expanding the House map.

That this race is in play is another sign that candidates matter, and that this cycle, Democrats have a lot of good ones in unlikely places.

* PREEXISTING CONDITIONS ARE A BIG MIDTERM ISSUE: A new Kaiser Family Foundation poll finds that Obamacare’s protections for preexisting conditions have wide support among voters and are a major issue in the midterm elections:

About two-thirds say a candidate’s support for continued protections for people with pre-existing health conditions is either the “single most important factor” or “very important, but not the most important factor.” … Three-fourths … say it is “very important” to them that the provision that prohibits health insurance companies from denying coverage because of a person’s medical history remains law.

It’s great for Republicans that Trump embraced a lawsuit to nix these protections that is so bogus that even lawyers backing previous bogus anti-ACA lawsuits have condemned it.

* THE PUBLIC HATES FAMILY SEPARATIONS: A new Politico-Morning Consult poll finds that 74 percent of Americans approve of Trump’s (likely temporary) reversal of his policy of separating children from parents. And:

More voters, 41 percent, say they trust Democrats in Congress when it comes to immigration — more than the 37 percent who trust Republicans. … Democrats have a 7-point on the generic congressional ballot, 44 percent to 37 percent, according to the poll.

Remember, Republicans screamed at Trump to stop the family separations, out of fear that it would destroy them politically, even as Trump insisted that they would juice the base.

* RELIGIOUS GROUPS QUIET ON MUSLIM-BAN RULING: The Post reports that religious groups that celebrated the Supreme Court’s recent ruling that a baker doesn’t have to serve gays have mostly been quiet about the ruling upholding Trump’s Muslim ban:

“I would have said we were in a period when the court was caring more about religion,” said Noah Feldman, a constitutional law scholar at Harvard University who focuses on law and religion. “But this makes it look like what the court cares about is the religion of evangelical Christians, not Muslims. … It looks badly motivated.”

As The Post notes, conservative religious groups didn’t have anything to say about the implications of the battle over the Muslim ban for religious liberty. Surprising!