Gregory Korte, and Melanie Eversley

USA TODAY

A federal judge in Texas has blocked President Obama's policy deferring the deportation of millions of undocumented immigrants.

In a 123-page opinion handed down late Monday, Judge Andrew Hanen ruled that the Department of Homeland Security did not allow public comment on its rules implementing Obama's executive action. He issued a preliminary injunction blocking the administration from implementing the deferred deportment program.

The White House immediately said that the Justice Department would appeal the decision.

"The Supreme Court and Congress have made clear that the federal government can set priorities in enforcing our immigration laws — which is exactly what the President did when he announced commonsense policies to help fix our broken immigration system," White House press secretary Josh Earnest said in a middle-of-the-night statement.

Texas Gov. Greg Abbott, a Republican, filed suit in December on behalf of Texas and 26 other states opposed executive action proposed by Obama in November.

The temporary injunction will halt the administration's actions on immigration — moves that could protect up to 5 million undocumented immigrants from deportation — as the states' lawsuit moves forward.

"President Obama abdicated his responsibility to uphold the United States Constitution when he attempted to circumvent the laws passed by Congress via executive fiat, and Judge Hanen's decision rightly stops the president's overreach in its tracks," Abbott said in a statement. "We live in a nation governed by a system of checks and balances, and the President's attempt to by-pass the will of the American people was successfully checked today."

The injunction is related to a program known as Deferred Action for Parents of Americans and Lawful Permanent Residents, or DAPA. The program allowed undocumented parents of lawful U.S. citizens or permanent residents to defer deportation and seek job benefits.

Part of the program was set to go into effect on Wednesday; it would have expanded deportation protections for people who were brought into the country illegally when they were children. Protections for parents of U.S. citizens and permanent residents was expected to start in May.

The judge made clear that his ruling does not apply to the Deferred Action for Childhood Arrivals, or DACA, which has granted legal status to the almost 700,000 teenagers and young adults born outside the United States.

Texas has standing to bring the lawsuit, the judge ruled, because the federal action would make thousands of newly legalized immigrants eligible for Texas driver's licenses. The state charges $24 per license, but they cost nearly $200 for the state to process — in part because of federal mandates under the REAL ID Act of 2005.

"If the preliminary injunction is denied, plaintiffs will bear the costs of issuing licenses and other benefits once DAPA beneficiaries -- armed with Social Security cards and employment authorization documents -- seek those benefits," Hanan wrote. "Once these services are provided, there will be no effective way of putting the toothpaste back in the tube should plaintiffs ultimately prevail on the merits."

Hanen, a district judge sitting in Brownsville, Texas, was nominated by President George W. Bush in 2002.

An appeal of the ruling would go to the 5th Circuit Court of Appeals in New Orleans.