The Justice Department on Thursday said it is dropping the criminal case against President Donald Trump’s first national security adviser, Michael Flynn, abandoning a prosecution that became a rallying cry for the president and his supporters in attacking the FBI’s Trump-Russia investigation.

The move is a stunning reversal for one of the signature cases brought by special counsel Robert Mueller. It comes even though prosecutors for the last three years have maintained that Flynn lied to the FBI in a January 2017 interview about his conversations with the Russian ambassador.

Flynn himself admitted as much, pleading guilty before asking to withdraw the plea, and became a key cooperator for Mueller, who investigated ties between Russia and the 2016 Trump campaign.

In court documents being filed Thursday, the Justice Department said it is dropping the case “after a considered review of all the facts and circumstances of this case, including newly discovered and disclosed information.” The documents were obtained by The Associated Press.

The Justice Department said it had concluded that Flynn’s interview by the FBI was “untethered to, and unjustified by, the FBI’s counterintelligence investigation into Mr. Flynn” and that the interview was “conducted without any legitimate investigative basis.”

The U.S. attorney reviewing the Flynn case, Jeff Jensen, recommended dropping the case to Attorney General William Barr last week and formalized the recommendation in a document this week.

“Through the course of my review of General Flynn’s case, I concluded the proper and just course was to dismiss the case,” Jensen said in a statement. “I briefed Attorney General Barr on my findings, advised him on these conclusions, and he agreed.”

The decision is certain to be embraced by Trump, who has relentlessly tweeted about the case and last week pronounced Flynn “exonerated,” and to energize supporters who have taken up the retired Army lieutenant general as a cause. But it will also add to Democratic complaints that Barr is excessively loyal to the president and could be a distraction for a Justice Department that for months has sought to focus on crimes arising from the coronavirus.

The department’s action comes amid an internal review into the handling of the case and an aggressive effort by Flynn’s lawyers to challenge the basis for the prosecution. The lawyers cited newly disclosed FBI emails and notes last week to allege that Flynn was improperly trapped into lying when agents interviewed him at the White House days after Trump’s inauguration. Though none of the documents appeared to undercut the central allegation that Flynn had lied to the FBI, Trump last week pronounced him “exonerated .”

The decision is the latest dramatic development in a years-old case full of twists and turns. In recent months, Flynn’s attorneys have leveled a series of allegations about the FBI’s actions and asked to withdraw his guilty plea. A judge has rejected most of the claims and not ruled on others, including the bid to revoke the plea.

The decision comes as Barr has increasingly challenged the Russia investigation, saying in a television interview last month that it was started “without any basis.” In February, he overruled a decision by prosecutors in the case of Roger Stone, another former Trump adviser, in favor of a more lenient sentence for the longtime Trump friend.

Earlier this year, Barr appointed Jensen of St. Louis to investigate the handling of Flynn’s case. As part of that process, the Justice Department gave Flynn’s attorneys a series of emails and notes, including one handwritten note from a senior FBI official that mapped out internal deliberations about the purpose of the Flynn interview: “What’s our goal? Truth/admission or to get him to lie, so we can prosecute him or get him fired?” the official wrote.

Other documents show the FBI had been prepared weeks before its interview of Flynn to drop its investigation into whether he was acting at the direction of Russia. Later that month, though, as the White House insisted that Flynn had never discussed sanctions with Russian Ambassador Sergey Kislyak, FBI officials grew more concerned by Flynn’s conversations with the diplomat and what he had communicated to the White House. The investigation remained open, and agents went to visit him in the White House on Jan. 24, 2017.

Justice Department officials visited the White House two days later to warn officials that they feared that Flynn was compromised and vulnerable to blackmail by Russia because of his account of what was said on the call. White House officials waited several weeks to oust him from the job, saying they’d concluded that Flynn had lied to them.

Flynn pleaded guilty that December, among the first of the president’s aides to admit guilt in Mueller’s investigation. He acknowledged that he lied about his conversations with Kislyak, in which he encouraged Russia not to retaliate against the U.S. for sanctions imposed by the Obama administration over election interference.

He provided such extensive cooperation that prosecutors said he was entitled to a sentence of probation instead of prison.

As it turned out, that sentencing hearing was abruptly cut short after Flynn, facing a stern rebuke from U.S. District Judge Emmet Sullivan, asked to be able to continue cooperating and earn credit toward a more lenient sentence.

Flynn’s misgivings about the case were already on display when his then-attorneys pointedly noted in their sentencing memo that the FBI had not warned him that it was against the law to lie when they interviewed him at the White House in January 2017.

Since then, he has hired new attorneys — including Sidney Powell, a conservative commentator and outspoken critic of Mueller’s investigation — who have taken a far more confrontational stance to the government. The lawyers have accused prosecutors of withholding documents and evidence they said was favorable to the case and have repeatedly noted that one of the two agents who interviewed Flynn was fired from the FBI for having sent derogatory text messages about Trump during the 2016 presidential campaign.