Fired FBI Deputy Director Andrew McCabe on Thursday sued the FBI and Department of Justice over his termination last year, alleging his ouster shortly before he was scheduled to retire was “legal nullity.”

In his 48-page complaint, McCabe alleges that Trump administration officials, “responded to Plaintiff’s two decades of unblemished and non-partisan public service with a politically motivated and retaliatory demotion in January 2018 and public firing in March 2018 — on the very night of Plaintiff’s long-planned retirement from the FBI.”

The former FBI official also claims that President Trump “purposefully and intentionally caused the unlawful actions of Defendants … and other Executive Branch subordinates that led to Plaintiff’s demotion and purported termination.”

“It was Trump’s unconstitutional plan and scheme to discredit and remove DOJ and FBI employees who were deemed to be his partisan opponents because they were not politically loyal to him. Plaintiff’s termination was a critical element of Trump’s plan and scheme,” the complaint reads.

He is requesting the judge rule that “his demotion was unlawful and his purported termination was either a legal nullity,” or ensure he is given retirement benefits he expected to receive upon retiring from the FBI.

McCabe’s lawsuit comes two days after former FBI agent Peter Strzok sued the FBI and the Department of Justice over his own firing, claiming his removal was “politically-driven and illegal.”

“The campaign to publicly vilify Special Agent Strzok contributed to the FBI’s ultimate decision to unlawfully terminate him,” the lawsuit states, “as well as to frequent incidents of public and online harassment and threats of violence to Strzok and his family that began when the texts were first disclosed to the media and continue to this day.”

McCabe was fired by Attorney General Jeff Sessions on March 16th, 2018, less than two days before the longtime Deep Stater was scheduled to retire.

Sessions said officials determined “that Mr. McCabe had made an unauthorized disclosure to the news media and lacked candor — including under oath — on multiple occasions.”

The firing was recommended by the FBI’s discipline office after the Justice Department’s inspector general investigation determined McCabe had authorized FBI officials to reveal sensitive information to the media about an investigation related to Hillary Clinton and subsequently misled investigators about his role in the matter.

McCabe stepped down as FBI deputy director after FBI Director Christopher Wray was briefed on the inspector general’s probe, although he remained an employee of the agency.

A criminal investigation into whether McCabe made false statements during an internal probe into a news media disclosure remains open, according to his attorney Michael Bromwich.

The investigation into the news media disclosure exposed a rift between McCabe and former FBI Director James Comey.

McCabe told the inspector general’s office that he told Comey after the article was published that he had allowed the officials to share particular information and that Comey responded that it was a “good” idea to rebut a one-sided narrative. But Comey is quoted in the report as saying McCabe never told him he had approved sharing details of the call and, in fact, had left him with the opposite impression.

Asked recently about his current relationship with Comey, McCabe replied tersely, “We don’t really have a relationship now.”

The Associated Press and UPI contributed to this report.