For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

In a dramatic court hearing Tuesday, a federal judge delayed the sentencing of Michael Flynn, President Donald Trump’s former national security adviser, so he could continue cooperating with special counsel Robert Mueller’s investigation.

The retired lieutenant general, who was fired from his position as the head of the Defense Intelligence Agency during the Obama administration, was a top Trump surrogate during the 2016 campaign, famously leading a chant of “Lock her up!” at the Republican National Convention. Shortly after his victory, Trump tapped Flynn as his national security adviser. But as the FBI ramped up its investigation into Russian election interference, Flynn’s contacts with then-Russian ambassador Sergey Kislyak quickly came under scrutiny. Interviewed by FBI agents four days after Trump’s inauguration, Flynn lied about his communications with Kislyak. He was forced out of the administration after just 24 days on the job.

In December 2017, Flynn pleaded guilty to lying to the FBI and acknowledged acting as an unregistered lobbyist for Turkey. Flynn was supposed to be sentenced Tuesday. But the judge, Emmet Sullivan, criticized his behavior harshly and grilled him about whether he accepted full responsibility for his crime, raising the prospect that Flynn could get prison time even though prosecutors had recommended he not be locked up. After Sullivan asked prosecutors whether Flynn could continue to be helpful, Flynn opted for the sentencing to be delayed until his cooperation is complete.

Flynn was the first high-profile Trump ally to become a cooperating witness in Mueller’s Russia probe. The retired three-star general ultimately met with prosecutors 19 times and provided what Mueller described in a recent sentencing memo as “substantial help.” Because of that cooperation and Flynn’s long record of military service, Mueller recommended Flynn face no prison time.

Tuesday’s courtroom drama was set off by a filing made by Flynn’s lawyers prior to sentencing that raised questions about whether Flynn knew lying to the FBI was a crime and why he was not represented by an attorney during his initial FBI interview. The filing suggested that Flynn might have been duped into making false statements, an assertion that Trump and his supporters jumped on immediately.

….The Russian Witch Hunt Hoax, started as the “insurance policy” long before I even got elected, is very bad for our Country. They are Entrapping people for misstatements, lies or unrelated things that took place many years ago. Nothing to do with Collusion. A Democrat Scam! — Donald J. Trump (@realDonaldTrump) December 16, 2018

But in court in Washington, DC, on Tuesday morning, under stern questioning from Sullivan, Flynn quickly walked back any suggestion he was not taking full responsibility.

“Were you not aware that lying to FBI investigators was a crime?” Sullivan asked Flynn.

“I was aware,” Flynn said, confirming that he still wanted to plead guilty.

Trump had clearly hoped Flynn and his lawyers would bolster the narrative that he was entrapped:

Good luck today in court to General Michael Flynn. Will be interesting to see what he has to say, despite tremendous pressure being put on him, about Russian Collusion in our great and, obviously, highly successful political campaign. There was no Collusion! — Donald J. Trump (@realDonaldTrump) December 18, 2018

After obtaining Flynn’s reassurances that he was indeed pleading guilty because he knew he was guilty of a crime, Sullivan proceeded to skewer Flynn, scolding him for lying to the FBI while on the premises of the White House. Sullivan said Flynn’s work as an unregistered agent on behalf of Turkey while also serving as national security adviser was stunning.

“Arguably, that undermines everything that this flag over here stands for. Arguably, you sold your country out,” Sullivan said. “I’m not hiding my disgust, my disdain for this criminal offense.”

At one point, Sullivan turned to prosecutors and asked them if Flynn could have been charged with treason—a crime punishable by death—for his actions. Prosecutors seemed unprepared for the question and said it hadn’t been considered. After taking a brief recess, Sullivan returned to court and noted that he was not accusing Flynn of treason and that Flynn’s official work for Turkey ended in mid-November, before he took the job as national security adviser.

On Monday, the Justice Department indicted two of Flynn’s associates, Bijan Kian and Ekim Alptekin, on charges of illegal lobbying in connection with an effort, in which Flynn was deeply involved, targeting a political foe of Turkish president Recep Tayyip Erdogan. In court Tuesday, prosecutors said Flynn had cooperated in that case. But Flynn’s lawyers said the Turkey case is the one area where there’s more cooperating for Flynn to do.

Sullivan scheduled the sentencing for March 13. But he cautioned that he wouldn’t necessarily opt for a more lenient sentence if Flynn continues to cooperate with prosecutors. “I’m not making any promises,” he said.