A federal judge in Texas ordered the Justice Department Thursday to send its "intentionally deceptive" lawyers back to ethics class, accusing them of misleading the court about President Obama’s executive immigration actions.

U.S. District Judge Andrew Hanen charged that the administration implemented a "calculated plan of unethical conduct" to hide the Department of Homeland Security’s immediate approval of extended work permits under Obama’s 2014 directive despite a federal court stay on the program.

"The misconduct in this case was intentional, serious and material," Hanen wrote in the 28-page ruling.

Texas is spearheading a legal battle with 25 other states against Obama’s executive order that would extend work permits to undocumented immigrations and prevent millions from deportation. Hanen blocked the program’s implementation in February 2015, leading to a separate court injunction on the actions. The merits of the case are currently before the Supreme Court.

Despite Hanen’s hold on Obama’s actions, the Justice Department proceeded to issue the extended three-year work permits. Soon after, the agency claimed it had made a mistake and rescinded the extensions from roughly more than 2,000 undocumented immigrations.

Hanen accused the administration’s lawyers of intentionally misleading the court when detailing how many permits had been issued.

"Clearly, there seems to be a lack of knowledge about or adherence to the duties of professional responsibility in the halls of the Justice Department," he wrote.

Hanen said any Justice Department attorney who wishes to appear in a state or federal court in the states suing the administration has to enroll in an annual three-hour ethics class. He also ordered administration officials to file a list of each immigrant who received extended work permits after he issued the injunction.

A Justice Department spokesman said that the agency "strongly disagrees with the order."

The Supreme Court is expected to rule on the case in June.