The U.S. Justice Department and the Obama administration have lost their first battle in the war over the president’s plan to provide “deferred action,” or amnesty, to almost 5 million illegal aliens.

When the judge for a Pennsylvania federal district court held on Dec. 16 that President Obama’s “Executive Action is unconstitutional because it violates the separation of powers and the Take Care Clause of the Constitution,” it must have felt like it came from left field, since the case didn’t involve a general attack on the immigration amnesty plan.

U.S. v. Elionardo Juarez-Escobar is a criminal prosecution of a Honduran who had already pled guilty in a case involving “reentry of a removed alien in violation of 8 U.S.C. §1326.”

Juarez-Escobar had been deported from the United States in 2005, but, like many illegal aliens, he reentered the country. He went to work for his brother’s landscaping business in Pittsburgh and was arrested in April in New Sewickley Township, Pa., for DUI and corrupting a minor who was in the car when he failed field sobriety tests with a 0.18 percent blood-alcohol level.

Juarez-Escobar was picked up by federal authorities after Homeland Security was notified of his arrest through the Secure Communities program, which, as Judge Arthur Schwab points out, is being terminated by the president’s “Executive Action” on immigration.

Before Juarez-Escobar could be sentenced, Obama announced his new immigration policy, on Nov. 20.

As a result, Schwab ordered the Justice Department to explain whether the president’s executive action applied to this defendant and whether there were any other “constitutional and/or statutory considerations” relevant to Juarez-Escobar’s prosecution.

The Justice Department filed only a four-page response claiming that the new amnesty policy applied only to civil immigration enforcement, not criminal proceedings. Schwab issued his opinion shortly thereafter.

In essence, Schwab found that what Obama did crossed the line and “constitutes ‘legislation,’ effectively changing United States’ immigration policy.

The president may only ‘take Care that the Laws be faithfully executed . . . ’; he may not take any Executive Action that creates laws.” Schwab also dismissed the legal excuse provided by the Justice Department to justify the president’s action: prosecutorial discretion.

As Schwab said, the president’s executive action goes far beyond prosecutorial discretion because:

1) it provides for a systematic and rigid process by which a broad group of individuals will be treated differently than others based upon arbitrary classifications, rather than case-by-case examination; and

2) it allows undocumented immigrants, who fall within these broad categories, to obtain substantive rights.

The court also dismissed the Justice Department’s claim that the executive action does not impact criminal proceedings, and specifically this one against Elionardo Juarez-Escobar.

According to Schwab, civil deportation proceedings often arise “after—or as a result of—the individual being convicted of a crime.” The court could not “ignore the fact that what happens here, in this criminal proceeding, significantly and determinatively impacts what happens there, in a civil proceeding.”

Nevertheless, the judge didn’t order the administration to quit implementing the president’s amnesty plan. It did give the defendant the option to withdraw his guilty plea “in light of the Executive Action” or to continue to the sentencing phase of this prosecution.

Texas is where the main action is.

The 24 states that filed a lawsuit against the amnesty plan on Dec. 3 (the 17 original states have been joined by another seven) and the specific Department of Homeland Security directive implementing it wasted no time in filing an “advisory” about the Pennsylvania decision with Judge Andrew S. Hanen of the Southern District of Texas (Brownsville Division) on Dec. 16.

Hanen, who has been assigned to the case, issued a searing indictment of the Obama administration’s immigration policy a year ago, calling its behavior “dangerous and unconscionable.” He said that “DHS should cease telling the citizens of the United States that it is enforcing our border security laws because it is clearly not. Even worse, it is helping those who violate these laws.”

The advisory filed with Hanen was almost gleeful in pointing out that Schwab had agreed with the “States’ constitutional arguments.” The states also maintained that this decision “further underscores the Plaintiff States’ likelihood of success on the merits.”

This is an important point because, on Dec. 4, the states followed up on their initial complaint by filing a motion for a preliminary injunction. They asked the court for an order stopping the Department of Homeland Security from implementing the president’s plan and the Homeland Security directive.

They asked for a hearing by Dec. 31 “or as soon as practicable thereafter.” Proving a likelihood of success on the merits is one of the factors required to obtain a preliminary injunction.

In the advisory, the states once again emphasized the importance of the preliminary-injunction request: “Moreover, given that one federal court already has concluded that the DHS Directive is unconstitutional, Plaintiffs respectfully request that this Court preserve the status quo and the full panoply of remedial options by scheduling a preliminary injunction hearing and enjoining the Directive.”

Finally, members of Congress have joined the fight. On Dec. 16, three senators—Ted Cruz, R-Texas, Roy Blunt, R-Mo., and John Cornyn, R-Texas—along with 24 House members, including Rep. Dave Brat (who replaced Eric Cantor in probably the biggest primary upset of the year), filed an amicus brief, through the American Center for Law and Justice, on behalf of the states and their request for a preliminary injunction.

The brief argues that Obama’s action and the Homeland Security directive violate the Constitution and the “comprehensive immigration scheme” created by Congress: “The DHS directive, at the admission of the President, changes the law and sets a new policy, exceeding Defendants’ constitutional authority and disrupting the delicate balance of powers.”

So the war in the courts has been joined in earnest over Obama’s immigration amnesty plan.

The president has lost the first fight in a minor skirmish in Pennsylvania, but the big battle is still to come in Texas. Hanen has not yet set a date for a hearing on the preliminary injunction. Whether the Texas case will turn out to be Obama’s Waterloo, only time will tell.

Originally appeared in National Review.