Michael Flynn, the former national security adviser to Donald Trump who was due to be sentenced for lying to federal investigators, is seeking to withdraw his guilty plea “because of the government’s bad faith, vindictiveness and breach of the plea agreement”, his lawyers said in a court document filed Tuesday.

Flynn was the first senior White House official to cut a deal in the special counsel Robert Mueller’s investigation into Russia’s 2016 election interference. After pleading guilty to lying to the FBI about conversations with the Russian ambassador during the presidential transition between Barack Obama and Trump, he went on to provide extensive information to federal prosecutors in exchange for leniency.

But in recent months, he grew less cooperative and suggested he hadn’t committed any crimes, leading prosecutors to recommend that he should be sentenced to up to six months in prison.

“Far from accepting the consequences of his unlawful actions, he has sought to blame almost every other person and entity involved in his case, including his former counsel,” prosecutors wrote in a document filed last week.

It appears Flynn and his legal team have doubled down, saying that the federal government breached the plea agreement with Flynn. They allege that prosecutors asked him to lie in another investigation, into his former business partner, Bijan Rafiekian.

Rafiekian was convicted for illegally lobbying to have a Turkish exile returned from the US, but a federal judge threw out the conviction, citing a lack of sufficient evidence.

In the court filing, Flynn’s lawyers said the justice department was attempting to “rewrite history” by suggesting he had not been forthcoming and should receive prison time. “Mr Flynn has cooperated with the government in good faith for two years. He gave the prosecution his full cooperation,” Flynn’s legal team wrote. “He endured massive, unnecessary, and frankly counterproductive demands on his time, his family, his scarce resources, and his life.”

As part of his plea deal, Flynn admitted he had lied to the FBI about discussing US sanctions on Russia with Sergey Kislyak, the Russian ambassador at the time. Flynn also said he lied about conversations with Kislyak discussing a UN security council resolution condemning Israel. Flynn’s sentencing was delayed in 2018 in exchange for continued cooperation with federal investigators, despite harsh rebukes from a federal judge who accused him of having “sold your country out”.

Federal prosecutors had initially said Flynn was entitled to avoid jail time, before reversing course after Flynn grew antagonistic. In June, Flynn fired his longtime attorneys and replaced them with a new team that included the former federal prosecutor Sidney Powell, a fierce critic of the Mueller investigation.