A federal judge ripped into Michael Flynn during an explosive court hearing Tuesday, scolding the former national security adviser to President Trump for selling “your country out” before postponing his sentencing.

Flynn avoided prison for the time being for lying to the FBI about his contacts with Russians, but couldn’t escape the firestorm U.S. District Judge Emmet Sullivan unleashed in the Washington courtroom.

Advertisement

“You were an unregistered agent of a foreign country while serving as the national security adviser to the President,” Sullivan said, his voice rising. “Arguably, you sold your country out.”

A pair of Flynn’s former business partners were charged Monday with trying to influence American politicians to seek the extradition of a Turkish cleric. Sullivan said he would delay sentencing until that case is finished.

“I’m not making any promises” about sparing Flynn from prison time, he warned.

The 60-year-old retired Army general pleaded guilty last December to misleading FBI agents about his conversations with Sergey Kislyak, the former Russian ambassador to the U.S., during the transition period following the 2016 election and spent the last year cooperating with special counsel Robert Mueller’s team.

However, his legal team sought to muddy the waters in recent weeks about the details of his initial sitdown with investigators.

Sullivan, who said he was having trouble “hiding my disgust,” sought to put to rest concerns raised about whether Flynn knew lying to federal agents was illegal and even offered him the chance to withdraw his guilty plea.

“I was aware,” Flynn responded when asked if he knew lying to the FBI was wrong.

Outside the courthouse, protesters sang “God Bless America” as Flynn and his wife were ushered into a waiting car following the heated hearing.

Late Tuesday, Sullivan ordered Flynn must turn over his passport and stay within 50 miles of Washington, D.C., starting Jan. 4, as he continues to cooperate with Mueller’s investigators.

Flynn served as Trump’s first national security adviser for less than a month before he was fired for misleading Vice President Pence about whether his discussions with Kislyak focused on lifting sanctions against Russia.

Mueller, probing Russian election interference and possible coordination between the Trump campaign and the Kremlin, had asked Sullivan to spare Flynn from serving any time in jail, noting his “substantial assistance” in ongoing investigations.

Despite his guilty plea, Flynn’s lawyers suggested in recent court documents that investigators discouraged him from having an attorney present during a January 2017 interview and failed to inform him it was a crime to lie to them.

Prosecutors responded by releasing a detailed memo documenting the sitdown.

According to the notes, the agents repeatedly offered Flynn to set the record straight on what he and Kislyak discussed. But Flynn never did so, falsely telling the agents he never talked sanctions with the ambassador.

Advertisement

“This is a very serious offense,” an incredulous Sullivan said. “A high ranking senior official of the government making false statements to the Federal Bureau of Investigation while on the physical premises of the of the White House.”

Trump, who has repeatedly railed against those who decide to assist federal investigations, signaled his continued support for Flynn with a “Good luck” tweet early Tuesday morning. “Will be interesting to see what he has to say, despite tremendous pressure being put on him,” Trump added.

Rudy Giuliani, Trump’s top attorney in the Mueller investigation, maintained Flynn was set up — even though the ex-White House official explicitly admitted in court that wasn’t the case.

“They obviously managed to jam him up,” Giuliani told the Daily News. “I have no doubt they did something wrong. (Flynn) said he did it, but do people sometimes say things to make a deal? Maybe.”