“A federal judge in Texas on Thursday tore into Justice Department lawyers who argued the immigration case involving the Obama administration, ordering them to take ethics classes.

In a blistering court order, U.S. District Court Just Andrew S. Hanen said he was “disappointed” about having to address the subject of lawyer behavior, calling it “at best, a distraction.”

Hanen said any Department of Justice attorney who wants to argue in a state or federal court in any of the 26 states involved in the immigration case must take an annual three-hour ethics course for the next five years.

“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,” Hanen wrote in his 28-page order, which quoted the films “Bridge of Spies” and “Miracle on 34th Street.”

The judge ordered Attorney General Loretta Lynch to provide a “comprehensive plan” within 60 days on how to “prevent this unethical conduct from ever occurring again.”