A Texas federal judge has ordered Justice Department attorneys to take annual ethics classes after he ruled they misled him regarding the implementation one part of President Obama's controversial immigration programs.

In late 2014, Texas and 25 other states filed a lawsuit challenging Mr. Obama's proposed executive actions that could protect around 4 million people from deportation and make them eligible to work in the United States.

Afterward, Judge Andrew Hanen of the US District Court for the Southern District of Texas, ordered a preliminary injunction blocking them. Before issuing the injunction, Justice Department attorneys told Judge Hanen that one program that protects children who were brought to the US illegally from deportation had not yet begun.

However, federal officials later said they had renewed the rights of more than 108,000 people to protection from deportation and given them work permits. Justice Department attorneys had previously insisted the protections were granted under 2012 guidelines, which weren't stopped by the injunction.

In a strongly worded order, which included movie references to "Miracle on 34th Street" and "Bridge of Spies," Hanen wrote that one thing was "indisputably clear," DOJ attorneys had misrepresented the facts.

"For whatever reason, the Justice Department trial lawyers appearing in this court chose not to tell the truth about this (Department of Homeland Security) activity," he wrote. "Such conduct is certainly not worthy of any department whose name includes the word 'Justice.' Suffice it to say, the citizens of all fifty states, their counsel, the affected (immigrants) and the judiciary all deserve better."

In an e-mail to the Associated Press, Justice Department spokesman Patrick Rodenbush said his agency "strongly disagrees with the order."

Hanen demanded that federal officials produce a list of the individuals who were given the three-year protections and that this information may be passed on to officials in states where these immigrants live. According to The New York Times, he said he would keep the list under seal until the US Supreme Court decides the fate of Obama's immigration plans.

"All personal identifiers and locaters including names, addresses, 'A' file numbers and all available contact information, together with the date the three-year renewal or approval was granted," the Times reported.

Hanen also ordered that any DOJ attorney in Washington, D.C., who needs to appear in a state or federal court in any of the 26 states that are part of the lawsuit will have to annually attend, for the next five years, a legal ethics course.

Furthermore, he ordered US Attorney General Loretta Lynch to present him with a comprehensive plan to prevent "this unethical conduct from ever occurring again" within 60 days.

Thursday's order does not effect the executive actions, which Hanen and the other states previously blocked. The Supreme Court heard arguments on the actions earlier this year and is expected to issue a ruling by the end of June. The case was argued before the high court in April.

The other states attempting to block Obama's orders are Alabama, Arizona, Arkansas, Florida, Georgia, Idaho, Indiana, Kansas, Louisiana, Maine, Michigan, Mississippi, Montana, Nebraska, Nevada, North Carolina, North Dakota, Ohio, Oklahoma, South Carolina, South Dakota, Tennessee, Utah, West Virginia, and Wisconsin.

This report contains material from AP.