Federal prosecutors Tuesday recommended that former national security adviser Michael Flynn serve up to six months in prison, reversing their earlier recommendation of probation after his attacks against the FBI and Justice Department.

The government revoked its request for leniency weeks after Flynn’s sentencing judge categorically rejected Flynn’s claims of prosecutorial misconduct and that he had been duped into pleading guilty to lying to FBI agents about his Russian contacts after the 2016 U.S. election.

“In light of the complete record . . . the government no longer deems the defendant’s assistance ‘substantial,’ ” prosecutor Brandon Van Grack wrote in a 33-page court filing. He added, “It is clear that the defendant has not learned his lesson. He has behaved as though the law does not apply to him, and as if there are no consequences for his actions.”

Flynn faces sentencing Jan. 28 before U.S. District Judge Emmet G. Sullivan in Washington. Flynn defense attorney Sidney Powell is scheduled to file his sentencing request Jan. 22.

The request marked the latest twist in the legal saga of the former Army lieutenant general and adviser to President Trump, whose rocky path after his candidate won the White House included serving the shortest tenure of a national security adviser on record — just 24 days — before resigning in February 2017. He then became a key witness in a probe into the administration, before breaking with the prosecutors who had credited him with helping them.

Flynn’s change of heart came after the end of special counsel Robert S. Mueller III’s probe of Russian election interference. Some Trump allies at that time pushed the president to pardon figures in the probe, particularly Flynn. A potential prison term could renew such calls.

Flynn, 61, pleaded guilty Dec. 1, 2017, to lying about his communications with then-Russian Ambassador Sergey Kislyak during the presidential transition, becoming the highest-ranking Trump official charged and one of the first to cooperate with Mueller’s office.

Flynn faces up to a five-year prison term under the charge, which included his misrepresentation of work advancing the interests of the Turkish government. However, ahead of Flynn’s initially scheduled sentencing in December 2018, prosecutors said he deserved probation for his “substantial assistance” in several ongoing investigations.

In a November 2018 filing, Mueller wrote that Flynn’s guilty plea “likely affected the decisions of related firsthand witnesses to be forthcoming . . . and cooperate.”

The special counsel noted Flynn’s “early cooperation was particularly valuable because he was one of the few people with long-term and firsthand insight regarding events and issues under investigation.”

Flynn admitted to being in touch with senior Trump transition officials before and after his pre-inauguration communications with Kislyak, which involved efforts to blunt Obama administration policy decisions on sanctions on Russia and a United Nations resolution on Israel.

Prosecutors had earlier singled out Flynn’s “exemplary” public service, including 33 years in the military and combat service to warrant a possible sentence of probation.

Flynn’s attorneys joined that recommendation.

But at a Dec. 18, 2018, sentencing hearing, Sullivan lambasted Flynn’s attorneys for appearing to play down his offenses. Under questioning by the judge, Flynn repeated under oath that he admitted he was guilty as Sullivan recited at length his misstatements to Vice President Pence, senior White House aides, federal investigators and the news media before and after Trump’s January 2017 inauguration about the nature of his foreign contacts.

“Arguably, you sold your country out,” Sullivan told Flynn, warning he might impose prison time. Flynn’s lawyers agreed to postpone the proceeding so that he could continue to show his good-faith cooperation.

This year Flynn switched defense lawyers, and his new team asked Sullivan to find prosecutors in contempt, alleging Flynn had been entrapped into pleading guilty and prosecutors wrongfully withheld evidence.

Flynn also broke with prosecutors in the July federal trial of his former business partner Bijan Rafiekian, on charges of illegally lobbying for Turkey. Flynn was set to be the star witness against Rafiekian. He told a grand jury he and Rafiekian campaigned “on behalf of elements within the Turkish government,” a project that included an op-ed under Flynn’s name on Election Day in 2016.

But just before the trial, Flynn claimed prosecutors wanted him to lie. A jury convicted Rafiekian without Flynn’s testimony, but a judge threw out those convictions in part because he found “insufficient” evidence of a conspiracy between the two men or of the Turkish government’s role.

U.S. prosecutors in the Eastern District of Virginia are appealing that conviction to the U.S. Court of Appeals for the 4th Circuit, writing in a motion Tuesday that the “case is significant.”

In withdrawing their request for leniency, Flynn’s prosecutors highlighted his hindrance of Rafiekian’s prosecution, the only cooperation they had initially deemed “substantial.”

The government recommended zero to six months of incarceration for Flynn, citing “the serious nature of the defendant’s offense, his apparent failure to accept responsibility, his failure to complete his cooperation in — and his affirmative efforts to undermine — the prosecution of Bijan Rafiekian.”

Prosecutors backed their claim Tuesday by filing dozens of pages detailing Flynn and his lobbying firm’s misconduct, including grand-jury transcripts and FBI interview reports. Overall, prosecutors said Flynn participated in 19 interviews with federal prosecutors and turned over documents and communications.

The substance of his cooperation was initially hidden, but most has come out in Mueller’s final report, subsequent trials or public records released as a result of lawsuits filed by news organizations.

Flynn told prosecutors a “very senior member of the Presidential Transition Team” — Trump’s son-in-law, Jared Kushner, according to people familiar with the matter — directed him to contact officials from foreign governments, including Russia, about the U.N. resolution on Israel.

Among other things, Flynn told Mueller that Trump and his campaign repeatedly sought to reach out to the anti-secrecy group WikiLeaks and obtain Hillary Clinton’s private emails, which the government has alleged were hacked by Russia — with Flynn offering to use his “intelligence sources” and contacting multiple people in an attempt to get them.

Flynn also informed the government of “multiple instances” in which he or his attorneys received communications from White House or congressional sources that could have affected his decision to cooperate or cooperate fully, including messages from Trump to “stay strong” and that “the president still cared for him.”