WASHINGTON – U.S. District Judge Emmet Sullivan laid into Michael Flynn at his Tuesday sentencing hearing, accusing the retired Army general of betraying his country by lying to the FBI and doing covert lobbying work on behalf of the Turkish government.

“You were an unregistered agent of a foreign country while serving as the national security adviser to the president,” Sullivan said.

“Arguably, this undermines everything this flag over here stands for,” Sullivan continued. “Arguably, you sold your country out.”

The judge warned Flynn he is considering imposing a prison sentence in his case.

Flynn pleaded guilty last year to one count of lying to FBI agents about his contacts with Russian officials as part of a plea arrangement with special counsel Robert Mueller. Though he was not charged for serving as an unregistered foreign agent for the work he did to benefit Turkey’s government, federal prosecutors made it clear during Tuesday’s proceedings that he could have faced significant criminal liability for that project.

Sullivan unloaded on Flynn for lying to the FBI in a January 2017 interview while he was serving in the highest levels of the federal government. The judge appeared outraged by assertions that Flynn was “entrapped” into making false statements to federal agents, as Flynn’s defense attorneys and supporters have suggested over the past few days.

Sullivan asked Flynn if he wanted to delay his sentencing in order “to challenge the circumstances under which” he was interviewed.

“No, your honor,” Flynn replied. “I was aware that lying to the FBI was a crime.”

Sullivan repeatedly pointed out that Flynn engaged in this “very serious offense” during an interview inside the White House itself.