A federal judge today ruled that President Obama’s executive actions on immigration are unconstitutional—the first time a court has weighed in since the president’s Nov. 20 announcement.

“President Obama’s unilateral legislative action violates the separation of powers provided for in the Constitution as well as the Take Care Clause, and therefore, is unconstitutional,” wrote U.S. District Court Judge Arthur Schwab, in a 38-page opinion.

President Obama’s immigration action “violates the separation of powers,” a district judge declared.

Schwab, an appointee of President George W. Bush, issued the ruling in a criminal case that was not a direct challenge to Obama’s moves.

The case involved a once-deported Honduran immigrant, Elionardo Juarez-Escobar, charged in federal court with illegally re-entering the United States after being arrested earlier this year in Pennsylvania for drunk driving.

The court only considered Obama’s immigration policy changes in sentencing Juarez-Escobar to see if he could qualify for deferred deportation under the president’s new enforcement guidelines.

Last month, Obama acted alone to shield up to 5 million illegal immigrants from deportation.

>>>What You Need to Know About Obama’s Executive Move on Immigration

The administration used the legal argument that the chief executive has “prosecutorial discretion” to decide when to enforce criminal infractions, including illegal immigration.

Schwab argues that Obama’s actions go “beyond” prosecutorial discretion by lumping a broad group of people into one case.

Schwab wrote:

President Obama’s executive action goes beyond prosecutorial discretion because: (a) 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 (b) it allows undocumented immigrants, who fall within these broad categories, to obtain substantive rights.

There are more cases pending that more directly challenge Obama’s actions.

Twenty-four states have filed suit questioning the legality of Obama’s policy reforms.

The states, led by Texas, charge that Obama violated his constitutional duty to enforce the laws and illegally placed new strains on state budgets.

Today, 27 Republican congressmen, including Sen. Ted Cruz of Texas and Rep. Bob Goodlatte of Virginia, filed an amicus brief in support of the states.

The Volokh Conspiracy first reported Schwab’s decision.