President Trump’s pardon of retired General Michael Flynn, who fleetingly served as his first national-security adviser, was a justified act of clemency.You don’t have to be a fan of how Trump has wielded his pardon power (often recklessly and on behalf of friends and supporters) or believe that Flynn was a good choice for national-security adviser or has conducted himself prudently and honorably the last several years (he hasn’t) to acknowledge that this is so.Flynn should never have been the subject of an FBI investigation; the FBI’s behavior in interviewing Flynn was reprehensible; and the pardon restores the appropriate balance of prosecutorial power, which was put askew by the misconduct of federal district-court judge Emmet Sullivan.It is due only to Judge Sullivan’s unhinged outbursts that Flynn was not convicted and sentenced on December 18, 2018. That is when Flynn, wanting at the time to put a sorry chapter behind him, appeared before Sullivan for what was anticipated to be sentencing.In late 2017, Flynn had pled guilty before a different judge to one count of making false statements to the government. These involved three matters: (a) lying to the FBI about the scope of his discussions with Russian ambassador Sergey Kislyak, during the Trump transition, regarding sanctions President Obama imposed over Moscow’s meddling in the 2016 election; (b) lying to the FBI about his transition discussions with Kislyak and other foreign leaders, in which he urged opposition to a U.N. resolution, supported by Obama behind the scenes, to condemn Israeli settlement activity; and (c) lying in Foreign Agent Registration Act (FARA) documents filed with the Justice Department, regarding the government of Turkey’s involvement in a project on which Flynn’s private intelligence firm had worked.None of this was particularly serious as a criminal matter. At the time of his conversations with Kislyak, Flynn was acting as a transition official designated to be the incoming president’s top security aide, and it was appropriate for him to engage in such discussions. Flynn did nothing to undermine the Obama sanctions, and his exchanges regarding the (abominable) Israel resolution had no effect. The Flynn firm’s involvement with agents of the Erdogan regime is troubling, but it is rare for the Justice Department to address FARA violations by criminal prosecution. In light of the other side of the ledger, namely Flynn’s history as a decorated combat commander who had served the United States with honor for over 30 years, this was an easy case: As a first offender convicted of a process crime in which the underlying basis for the investigation -- suspicion of a criminal conspiracy between the Trump campaign and Russia -- was baseless, Flynn should have been sentenced to no jail time.Sullivan inherited the case after the first judge recused himself. To his credit, he did not merely rely on the transcript of Flynn’s initial guilty plea. Because Flynn’s defense and defenders were publicly suggesting that he was innocent and had been coerced into pleading guilty, Sullivan conducted a second guilty-plea colloquy. Under oath, Flynn conceded that he had willfully made false statements, that he was pleading guilty because he was guilty, that he had not been coerced into the plea, that he had not been entrapped by the FBI, and that he had no complaints about the representation provided by his lawyers. Furthermore, he declined Sullivan’s repeated offers to allow him to withdraw his plea and fight the case.But then Sullivan went rogue. Despite the relatively minor nature of Flynn’s offense, the judge admonished Flynn that he had “undermine[d] everything” the American flag “stands for,” and that “arguably, you sold your country out.” For good measure, Sullivan added, “I’m not hiding my disgust, my disdain for this criminal offense,” and asked whether prosecutors had considered whether Flynn “could have been charged with treason” -- a slander for which Sullivan later apologized. This bizarre performance induced Flynn to withdraw his request to be sentenced promptly. Seeing what he was up against, Flynn retained combative new counsel (Sidney Powell, now of “Unleash the Kraken” fame) and fought the charge, maintaining his innocence despite having pled guilty twice, in extensive detail.Obviously, there has been a political dimension to Sullivan’s obstruction of the Justice Department’s subsequent decision to drop the Flynn case. It also seems likely that he has been motivated by the awareness that, were it not for his own injudicious tirade, the case would have been closed two years ago.Attorney General Bill Barr directed a review of Flynn’s case as part of the Justice Department’s ongoing investigation of the politicized origins of the Trump-Russia probe. That review, conducted by the U.S. attorney for St. Louis, an experienced prosecutor and former FBI agent, uncovered that there was scant basis for investigating Flynn -- who was deeply unpopular among Obama officials. Obama fired him from his job as head of the Defense Intelligence Agency and then Flynn joined the Trump campaign and publicly bashed Obama foreign and counterterrorism policy.There was no evidence that Flynn was a clandestine foreign agent, nor that he had committed penal offenses -- and thus no reasonable predicate for either a counterintelligence or a criminal investigation. Yet the FBI scrutinized Flynn on the assumption that he was a Kremlin mole. After Trump won the 2016 election, the bureau first concluded that its ludicrous investigation should be closed, but then used the pretext of Flynn’s Kislyak conversations to extend it.Without seeking permission from the Justice Department or White House counsel, as protocols require, the FBI’s then-director, James Comey, directed agents to interview Flynn at the White House in his first full day as national-security adviser. The FBI’s then-deputy director, Andrew McCabe, softened up Flynn by urging him not to alert the White House or retain counsel. The interviewing agents, including the since-terminated Peter Strzok, schemed not to give the bureau’s standard warnings about the nature of the interview and the fact that false statement could result in prosecution. Though the interviewing agents had recordings of Flynn’s Kislyak conversations, they did not share those with Flynn to refresh his recollection; their clear purpose was to induce inaccurate statements that could be used as a basis for Flynn’s firing and/or prosecution.Flynn, of course, was fired for giving Vice President Pence an inaccurate account of his conversations with Kislyak (it’s hard to know in retrospect how much of this was a genuine misunderstanding and how much calculated dishonesty on Flynn’s part). But even the Comey FBI did not press for Flynn’s prosecution because the agents did not believe he lied. Months later, Mueller’s team of aggressive prosecutors, many of them activist Democrats and former Obama DOJ officials, turned up the pressure on Flynn to plead guilty -- and the recently disclosed paper record shows that this included signaling to Flynn that his son (who worked for the Flynn intelligence firm) could be prosecuted for FARA violations.Taking all these factors into account, Barr decided to dismiss the case. The Justice Department reasoned that because there was no basis to investigate Flynn, his statements to the agents were not “material,” an essential proof element of a false-statements charge. The Justice Department further believed that Flynn would be acquitted if the case went to trial. These conclusions are not air-tight, but they are reasonable. More significantly, they are conclusions DOJ is entitled to make, and makes every day, because decisions about whether to prosecute, including whether to see a prosecution through to its conclusion, are exclusively for the executive in our system.Judge Sullivan’s intrusion on prosecutorial discretion has been outrageous. He has exploited a flaw in criminal procedural law that requires “leave of the court” to dismiss a case -- a provision that is intended to protect defendants from abuse -- in order to continue subjecting the defendant to a prosecution that the only legitimate prosecuting authority wants to cease. Sullivan even invited a Trump-bashing former federal judge to theorize how the court might prosecute Flynn if the Justice Department won’t. And Sullivan has willfully declined to rule on the dismissal motion, calculating that if Trump lost the election, he would have to pardon Flynn or risk that Sullivan’s dilatory strategy would give a Biden Justice Department the opportunity to revive the prosecution.The president’s pardon of Flynn restores the executive branch’s prosecutorial discretion and ends a case that should never have started. There are, however, no heroes in this dismaying saga.