The legal battle over the future of the Deferred Action for Childhood Arrivals (DACA) program — which grants temporary protection from deportation and work permits to nearly 700,000 unauthorized immigrants who came to the US as children — has just become a two-front war.

The Trump administration’s efforts to wind down DACA starting in September 2017 were challenged — and have been partially, temporarily thwarted — by lawsuits from the left. Under rulings from two federal judges, the administration is currently allowing immigrants who already have DACA to apply for two-year extensions of their work permits; a third federal judge is threatening to force the administration to start allowing immigrants who qualify to apply for DACA for the first time, too.

Now the administration is being sued from the right — by six Republican states, led by Texas, that claim DACA is unconstitutional and the administration shouldn’t continue the program at all.

The lawsuit won’t immediately affect how DACA is working on the ground. But it makes it absolutely certain that the Supreme Court will ultimately have to take up the constitutionality of both DACA and the Trump administration’s attempt to end it.

And there’s a chance the new lawsuit will create an extremely unusual legal quandary: simultaneous nationwide rulings compelling government officials to process DACA renewals, and preventing them from doing just that.

Donald Trump and Jeff Sessions said they were ending DACA because they were worried Texas might sue

The Texas-led lawsuit against Trump over DACA is, in a sense, totally predictable. After all, the possibility that Texas and other states would sue to end DACA was the main reason — or, at least, the main reason offered to the public — why President Trump and Attorney General Jeff Sessions decided that DACA needed to end in the first place.

When President Obama created DACA in 2012, there weren’t any credible legal challenges to the program — Republicans didn’t seem terribly enthused about fighting to keep people who’d lived in the US for years, attended American schools, and spoke fluent English from staying in the country. But in 2014, when Obama attempted to expand DACA and create a similar program for parents of US citizens and permanent residents, Texas led the group of red states that sued.

Federal Judge Andrew Hanen, in the Southern District of Texas, sided enthusiastically with the states, issuing an order temporarily blocking the Obama administration from starting up the new programs just as they were about to go into effect. The Fifth Circuit agreed, and in 2014, an eight-member Supreme Court deadlocked 4-4 — putting the programs on hold until the election of Trump.

Trump had promised on the campaign trail to end Obama’s “unconstitutional executive orders” — which Republicans assumed by that time to include not only the 2014 programs that had never actually been created but also DACA itself. But Trump failed to pull the trigger on DACA, agonizing publicly for several months over what to do with immigrants he’d once described as “terrific.”

So Texas and a group of 10 other red states threatened to force his hand. In June 2017, Texas Attorney General Ken Paxton wrote a letter to the administration saying that if DACA were still in place on September 5, 2017, they’d sue over DACA the way they’d sued over the 2014 executive orders.

On that September 5 deadline, Sessions formally announced that DACA was ending: New applications would no longer be accepted, immigrants whose work permits expired in the next six months would have one month to apply for a final renewal, and immigrants whose work permits expired after March 5, 2018, would simply become fully unauthorized again. The reason he provided: “If we were to keep the Obama Administration’s executive amnesty policy, the likeliest outcome is that it would be enjoined — just as” the 2014 executive actions were.

Judges have ruled in favor of DACA partly because it’s never been ruled unconstitutional

But then other federal courts stepped in to keep DACA alive. In January, the Northern District of California ordered the Department of Homeland Security (DHS) to start allowing current DACA recipients to apply for two-year renewals again. (Because that order allowed immigrants whose work permits expired after March 5 to apply for renewals, it reduced the importance of the March 5 “deadline” that Trump had set for Congress to act.) A federal judge in the Eastern District of New York issued a similar ruling. And last week, a federal judge in the DC district threatened to force the Trump administration to start accepting new DACA applications too.

One consistent theme in the rulings against Trump’s efforts to end DACA is that the administration simply assumed the program was unconstitutional without actually showing its work. “That legal judgment was virtually unexplained,” the judge in the DC case wrote, “and so it cannot support the agency’s decision.” The DC ruling gives Trump’s DHS 90 days (through July 23) to come up with a better argument for ending DACA; if it can’t, or if the judge finds its attempt insufficient, DHS will be forced to start allowing new DACA applications from people who didn’t apply before 2017.

If the problem was that no court had actually ruled DACA unconstitutional, Texas and company are trying to solve that problem now. They filed their lawsuit in the same district they’d successfully gotten to rule against Obama on the 2014 orders. And the case was deliberately sent to the judge, Andrew Hanen, who had sided so enthusiastically with the states suing Obama in 2014.

Hanen has voiced skepticism, to say the least, about the constitutionality of DACA. It’s a pretty solid bet that he doesn’t believe it’s constitutional.

The question is what he’d do about it, and when.

What happens if one judge forces Trump to keep DACA alive and another forces him to kill it?

Judge Hanen probably won’t have a chance to issue a ruling against DACA — or even a preliminary injunction temporarily halting the program — for several months. The first conference of attorneys in the case is scheduled for July 31. (By that time, the Trump administration might be forced under the DC ruling to start processing new DACA applications.) Sessions’s Department of Justice might decide not to defend DACA against the Texas suit, but a third-party advocacy group would almost certainly step in as an “intervenor” in that case.

But the chance is very real that at some point, the preliminary injunctions forcing the Department of Homeland Security to process DACA applications could be met with a preliminary injunction from Judge Hanen forcing them to stop.

This would be a mind-bendingly weird situation.

There would likely be a lot of pressure on the Fifth Circuit Court of Appeals to issue a stay blocking Hanen’s order as quickly as possible so that there were only injunctions in one direction in effect. After all, in theory, multiple rulings in DACA’s favor ought to outweigh a single ruling against it.

But legally speaking, the Fifth Circuit has no obligation to defer to lower-court judges in other circuits, or even to other circuit courts. The Supreme Court might ultimately have to figure out how to resolve the paradox.

Even if the problem got quickly resolved by courtroom standards — say, a few days — that’s still a few days during which US Citizenship and Immigration Services adjudicators would have to arrive at the office simultaneously compelled by the courts to work through the stack of DACA renewal applications on their desks and prevented from doing just that.

It’s genuinely not clear what they would end up doing. “I’m not aware of a prior situation in which there have been conflicting injunctions against the government,” says law professor Stephen Legomsky of Washington University. But he speculates that if the administration thought it had more than one legally defensible option, it might decide to stop processing DACA applications that came from immigrants living in Hanen’s district — or even to stop processing all applications from immigrants not living in the districts where the original pro-DACA injunctions were issued.

The paradox wouldn’t make or break any individual immigrant’s DACA application, but it could further gum up an approval process that’s already been worrisomely slow in some cases.

In recent years, some legal scholars have gotten worried about how often lower-court judges use nationwide injunctions to stop federal programs. In fact, it’s one of the questions the Supreme Court has raised in the case Trump v. Hawaii, over the latest version of Trump’s travel ban.

But the Supreme Court isn’t likely to resolve that question in its travel ban ruling broadly enough to prevent a potential DACA train wreck in late summer or fall. And if such a train wreck happens, the Supreme Court might have to get involved in the DACA cases on an emergency basis. And if the Supreme Court is more worried about the courts stopping the Trump administration from doing what it wants with DACA than it is about one injunction outweighing two or three, it might put a stop to DACA’s revival more quickly than it would have had Texas never opened up a second front.