In a settlement deal disclosed Thursday, fired FBI Deputy Director Andrew McCabe has had his government pension fully restored.

McCabe, 53, who has been a CNN contributor since 2019, had filed a lawsuit that year, claiming his firing was an effort by the Trump administration to rid the FBI of officials who were seen as disloyal to the then-president. Nearly a year before McCabe was ousted in March 2018, the Trump administration had terminated James Comey, who was the bureau’s director.

In McCabe’s case, the inspector general for the U.S. Justice Department, which oversees the FBI, concluded McCabe had OK’d the release of information to a newspaper reporter and then misled investigators who were seeking information about his role in the alleged leak, The Associated Press reported.

SENATORS GRASSLEY, JOHNSON DEMAND AG GARLAND PROVIDE UPDATE ON DECLASSIFICATION OF REMAINING RUSSIA PROBE DOCS

McCabe, who first joined the FBI in 1996, was fired by then-Attorney General Jeff Sessions, just hours before McCabe had planned to retire from the bureau. The firing prompted McCabe’s pension to be denied, the AP reported.

Trump quickly acknowledged McCabe’s ouster on Twitter, writing: “Andrew McCabe FIRED, a great day for the hard working men and women of the FBI – A great day for Democracy. Sanctimonious James Comey was his boss and made McCabe look like a choirboy. He knew all about the lies and corruption going on at the highest levels of the FBI!”

Former President Trump, right, called is a “great day for Democracy” when former FBI Deputy Director Andrew McCabe was fired in March 2018.

The settlement deal reached this week vacates Sessions’ decision, removes from McCabe’s FBI record any references to having been fired, and restores his retirement money, according to the AP.

In a statement upon the disclosure of the deal, McCabe alleged that his firing was politically motivated.

“Politics should never play a role in the fair administration of justice and civil service personnel decisions,” McCabe’s statement said, according to the AP.

He added that he hoped his settlement agreement “encourages the men and women of the FBI to continue to protect the American people by standing up for the truth and doing their jobs without fear of political retaliation.”

McCabe was never criminally charged in connection with the inspector general’s findings.

The Justice Department, which admitted no wrongdoing in the settlement, did not immediately respond to an AP request for comment about the deal with McCabe.

McCabe became acting director of the FBI after Comey’s firing, which came amid the Russia investigation into alleged ties between Moscow and the Trump 2016 campaign.

Last November, McCabe was grilled over the Russia probe during a hearing before the Senate Judiciary Committee. During that hearing, McCabe said he regretted signing the FBI’s warrant application requesting surveillance of former Trump campaign adviser Carter Page.

CLICK HERE TO GET THE FOX NEWS APP

That document had been found to contain factual inaccuracies but McCabe declined to name people who may have been responsible for the inaccuracies.

Following McCabe’s appearance before the Senate panel, former U.S. Attorney Brett Tolman blasted McCabe’s testimony as a “disaster” during an appearance on “Fox & Friends.”

“This is a prime example of someone who has inconsistencies, lies, deception during a period of time that has been uncovered and then trying to keep it all straight. I mean, this testimony was a disaster,” Tolman told “Fox & Friends.”

Fox News’ Ronn Blitzer and Joshua Q. Nelson and The Associated Press contributed to this story.