A federal judge sharply scolded a Justice Department attorney at a hearing on President Obama's immigration executive actions, suggesting that the administration misled him on a key part of the program -- and that he fell for it, "like an idiot." 

The testy court hearing was held Thursday in Texas by U.S. District Judge Andrew Hanen. The judge suggested he could order sanctions against the administration if he finds they indeed misrepresented the facts. 

At issue is whether the DOJ misled the judge into believing that a plank of the Obama program -- giving deportation reprieves to thousands of young illegal immigrants brought to the U.S. as children -- would not go forward before he made a ruling on a request to halt it. In fact, federal officials had given more than 108,000 people three-year reprieves before that date and granted them work permits under the program. 

Obama's executive actions would spare from deportation as many as 5 million people who are in the U.S. illegally. Many Republicans oppose the actions, saying only Congress has the right to take such sweeping action. Twenty-six states led by Texas joined together to challenge them as unconstitutional. Hanen on Feb. 16 sided with the states, issuing a preliminary injunction blocking Obama's actions. 

Hanen chided Justice Department attorney Kathleen Hartnett for telling him at a January hearing before the injunction was issued that nothing would be happening with regard to one key part of Obama's actions, an expansion of the 2012 Deferred Action for Childhood Arrivals program, known as DACA, until Feb. 18. 

More On This...

"Like an idiot I believed that," Hanen said. 

A flustered Hartnett repeatedly apologized to Hanen for any confusion related to how the reprieves and work permits were granted. 

"We strive to be as candid as possible. It truly became clear to us there was confusion on this point," she said. 

Hartnett continued to insist that the 108,081 reprieves had been granted under 2012 guidelines, which were not stopped by the injunction, and that government attorneys hadn't properly explained this because they had been focused on other parts of the proposed action. 

But Hanen pointed out that the 2012 guidelines only granted two-year reprieves and that three-year reprieves are being proposed under the program now on hold. 

"Can I trust what the president says? That's a yes or no question," Hanen asked. 

"Yes your honor," Hartnett replied. 

The states asked that Hanen consider issuing sanctions because Justice Department attorneys had made "representations (that) proved not to be true or at a minimum less than forthcoming," said Angela Colmenero, a lawyer with the Texas Attorney General's Office, the lead attorney for the states. 

Colmenero said the three-year reprieves that were granted might have caused the states economic harm as the states may have already issued various benefits, including driver's licenses, to immigrants who received a reprieve. 

"There is absolutely no basis for sanctions here," Hartnett said. "The government is absolutely trying to do the right thing." 

Hanen said he would issue a ruling "promptly" on what action, if any, he will take against the Justice Department. 

The federal government has asked the 5th U.S. Circuit Court of Appeals in New Orleans to lift Hanen's injunction while the case is appealed. 

The other states seeking 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. 

The Associated Press contributed to this report.