Michael Flynn committed perjury, and his guilty plea of lying to the FBI should not be dismissed, a court-appointed adviser argued to a federal judge Wednesday, calling the Justice Department’s attempt to undo the conviction corrupt, politically motivated and “a gross abuse of prosecutorial power.”

In a formal briefing to the judge overseeing Flynn’s case, former New York federal judge John Gleeson said Flynn’s guilt “could hardly be more provable.” He issued a sharp rebuke of the Justice Department’s move to abandon the long-running case and called out President Trump for refusing to accept “settled foundational norms of prosecutorial independence.”

“The Government has engaged in highly irregular conduct to benefit a political ally of the President,” Gleeson wrote in an 82-page brief to U.S. District Judge Emmet G. Sullivan.

Gleeson argued that though Flynn committed perjury by first admitting under oath to lying to the FBI about his Russian contacts and then seeking to rescind his guilty plea, Trump’s former national security adviser should not face a contempt hearing but instead be punished as part of his sentence.

“Flynn has indeed committed perjury in these proceedings, for which he deserves punishment, and the Court has the authority to initiate a prosecution for that crime,” Gleeson wrote. However, Gleeson said, moving Flynn’s case to sentencing “— rather than a separate prosecution for perjury or contempt — aligns with the Court’s intent to treat this case, and this Defendant, in the same way it would any other.”

Sullivan has paused Flynn’s case to hear from outside groups and appointed Gleeson to argue against the Justice Department’s May 7 motion to immediately drop its prosecution of the retired three-star general. Flynn was the highest-ranking Trump adviser convicted in special counsel Robert S. Mueller III’s investigation of Russian interference in the 2016 election.

Sullivan has set a July 16 hearing to weigh the unusual request, which came after Attorney General William P. Barr ordered a review of Flynn’s case. In the Justice Department’s motion, which is supported by Flynn and prompted a career department prosecutor to quit the case, the agency said it concluded that Flynn’s January 2017 FBI interview was unjustified. The Justice Department also said the interview was “conducted without any legitimate investigative basis,” so any lies Flynn told about his contacts with Russia and other foreign governments were immaterial to any crime.

The department cited newly uncovered FBI records showing the bureau had decided to close a counterintelligence investigation of Flynn before learning of his calls with former Russian ambassador Sergey Kislyak. The Justice Department said FBI officials also knew that the calls probably did not give rise to a crime by themselves and differed over how to handle or interpret his actions.

In his brief, Gleeson blasted the “transparent disingenuousness” of the Justice Department and Barr’s arguments, citing “clear evidence” of prosecutorial abuse and “pure misdirection” to exonerate a top Trump aide.

The government’s reversal in Flynn’s case prompted criticisms that the Justice Department is bending the rule of law to appease the president. In March, Trump said he was “strongly considering” a pardon for Flynn, who the president said was a victim of “dirty, filthy cops at the top of the FBI.”

Gleeson said the government’s “ostensible grounds” for seeking dismissal were “conclusively disproven” by its own earlier arguments in the case; contradict the court’s prior orders and Justice Department positions taken in other cases; and “are riddled with inexplicable and elementary errors of law and fact.”

A former federal prosecutor and judge for 22 years in Brooklyn — best known for putting the late mob boss John Gotti behind bars and presiding over the trial of “Wolf of Wall Street” stockbroker Jordan Belfort — Gleeson wrote that judges are empowered to protect their courts’ integrity “from prosecutors who undertake corrupt, politically motivated dismissals. That is what has happened here.”

The U.S. Court of Appeals for the District of Columbia Circuit is set to hear arguments Friday over Flynn’s request for the federal appeals court to intervene, either by ordering Sullivan to drop the prosecution or reassigning the case to a different judge because of bias.

The Justice Department restated its position that prosecutors have exclusive authority to decide whether to drop a case and criticized Gleeson’s role in a response to the court Wednesday, saying, “Such a politically charged examination in a judicial forum imperils the Judiciary’s own reputation.”

Flynn attorney Sidney Powell in a separate filing likewise rebuked Gleeson for “playing [attorney general],” adding, “That is precisely why this Court’s intervention is needed now—not after [Sullivan] and his Amicus create a circus and sentence an innocent man.”

But Sullivan lawyer Beth Wilkinson said it is premature for the panel to intervene because Sullivan has not decided on the government’s request but only established a process to consider it.

“After spending more than two years convincing the district court of Mr. Flynn’s crimes and enlisting its Article III power to convict him, it is not asking too much for the government and Mr. Flynn to participate in that process before the district court rules,” she wrote.

Flynn awaits sentencing after pleading guilty to lying in an FBI interview on Jan. 24, 2017, to conceal conversations with Kislyak. Flynn later admitted to being in touch with senior Trump transition officials before and after his communications with Kislyak, which involved efforts to blunt Obama administration policy decisions on sanctions against Russia and a United Nations resolution on Israel before Trump took office.

Flynn repeated the lie to White House staff and Vice President Pence, leading to the firing of Trump’s first national security adviser three weeks later.

Flynn admitted his conduct under oath three times before two federal judges. He reversed course after Mueller’s investigation ended and Barr took office last year. Flynn switched defense teams, accusing prosecutors and his former attorneys of misconduct and asserting his innocence.

Gleeson called the Justice Department’s argument for its reversal distorted and false, offered as “sleight-of-hand to camouflage” actions to serve the president’s personal political interests.

“Pursuant to an active investigation into whether President Trump’s campaign officials coordinated activities with the Government of Russia, one of those officials lied to the FBI about coordinating activities with the Government of Russia,” Gleeson said.

“That is about as straightforward a case of materiality as a prosecutor, court, or jury will ever see,” he wrote.

If a defendant in any other false-statements case demanded knowing whether investigators at one point thought about closing the investigation, the evidence on which the investigation was based, or what agents subjectively believed at various points, “the Government would scoff at those demands, and this Court would summarily deny them,” Gleeson asserted.

“There is no other case in which the DOJ has taken the position that an interviewee can lie with impunity to federal investigators so long as he has committed no other provable crimes,” Gleeson added, especially in a counterintelligence investigation, which are often intended to prevent future security breaches.

Flynn faces a sentence of zero to six months under his initial plea deal, although prosecutors at one point recommended he get probation and no prison time.

Gleeson’s brief was joined by colleagues from the Debevoise & Plimpton law firm, including David O’Neil, who assisted House Democrats in Trump’s Senate impeachment trial, and Kaplan Hecker & Fink attorneys including Marshall L. Miller and Joshua Matz.