Lawyers for the federal government have been squirming for more than a year under the threat of punishment from a Texas judge who’s convinced they lied to him about President Obama’s immigration program. They may be uncomfortable a while longer.

When U.S. District Judge Andrew S. Hanen in Brownsville blocked administration plans to shield more than 4 million undocumented immigrants from deportation and give them work permits, he extracted a promise from Justice Department attorneys — in person and in writing — that “nothing would happen” before his order took effect.

Hanen didn’t hide his fury when government officials issued about 100,000 work permits in spite of the department’s assurances. He accused the lawyers of being intentionally deceptive. One Justice Department attorney visibly shook during a hearing last year and hasn’t been back to Hanen’s courtroom. The judge also ordered the Justice Department to take several attorneys off the high-profile case, adding that he would yank their law licenses if it were up to him.

On Wednesday, the judge listened as a Justice Department lawyer told him attorneys on the case unintentionally provided bad information because they had either forgotten bureaucrats had begun issuing the work permits or didn’t think it was important to the main immigration reforms being challenged.

“First, we are sorry for the mistakes that we made that led to this situation,” James Gilligan told Hanen. “Sorry for leading this court to believe it had been misled. Sorry for the time and energy this issue has consumed.”

Trump Wall

The fight over immigration policy has been a key talking point in the presidential race, with Republican nominee Donald Trump arguing for construction of a wall along the U.S.-Mexico border and demanding that Mexico pay for it. Wednesday’s court hearing coincided with Trump’s visit with Mexican President Enrique Pena Nieto. Trump said after their meeting that the two discussed the wall but not who would pay for it.

Keep up with the race of a lifetime.
Get our politics newsletter daily.

In May, when it appeared the U.S. Supreme Court would decide the immigration-plan challenge and Hanen’s role in the controversy was over, he ordered more than 3,000 Justice Department Lawyers to take at least three hours of ethics training every year for five years. That mandatory class time would be required of any federal lawyer who practices in any of the 26 states that sued over Obama’s immigration initiative.The Justice Department argued Hanen had overstepped his authority and pegged the cost of complying with his order at almost $8 million.

Gilligan told Hanen in court that the Justice Department will require all 1,000 of its civil division lawyers –- even senior management –- to complete an hour of customized ethics training within 120 days, “regardless of how this court rules” on the misconduct allegation.

‘Worthy Step’

“I greatly appreciate that,” Hanen replied. “It’s a worthy step.”

Hanen said he will issue a ruling later on whether Justice Department lawyers should face sanctions.

Hanen, an appointee of Republican President George W. Bush, had mocked government lawyers in his order for failing to demonstrate what he considered common sense. He illustrated his point by quoting scenes from a pair of Hollywood films, including one where a child tells a prosecutor, “Gosh, everybody knows you shouldn’t tell a lie, especially in court.”

“You’re telling a judge, ‘We can lie, cheat and steal, and you can’t do anything about it?’” Hanen asked Justice Department lawyers at a hearing in June, according to a transcript.

Hanen has said he’s sanctioned attorneys only twice in his 14 years on the bench, imposing a fine in one instance and requiring a letter of apology in the other. But as much as he dislikes punishing fellow attorneys, he said he can’t “do nothing,” as the administration has asked.

‘Magic Gavel’

“If you polled every judge in the world, they would say a judge is not doing his or her job if he allows unethical conduct to go on in their court,” Hanen told lawyers in June. “I wish there was a way we could wave a magic wand –- or maybe a magic gavel since I’m a judge –- and say, all right, let’s have a do-over. But there’s not.”

The deliberations over punishment for the lawyers comes before a trial on whether Obama has the power to carry out his immigration plan. The Supreme Court refused to overturn Hanen’s injunction in a 4-4 vote, but didn’t comment on it. The justices sent the case back for trial, which Hanen hasn’t scheduled.

The case is Texas v. U.S., 14-cv-00254, U.S. District Court, Southern District of Texas (Brownsville).