In this June 7, 2017, file photo, then-acting FBI Director Andrew McCabe appears before a Senate Intelligence Committee hearing about the Foreign Intelligence Surveillance Act, on Capitol Hill in Washington. McCabe has sued the FBI and the Justice Department over his firing. Credit: Alex Brandon | AP

WASHINGTON – Andrew McCabe, the acting FBI director who authorized an investigation into President Donald Trump for ties to Russia and possible obstruction of justice, filed a lawsuit against the bureau and the Justice Department on Wednesday, alleging he was illegally demoted and fired as part of a plot by Trump to remove those who were not politically loyal to him.

McCabe asked that a federal judge declare his termination a “legal nullity” and essentially allow him to retire from the FBI as planned, with all the benefits that would have afforded him. He was fired from the bureau in March 2018, a little more than 24 hours before McCabe was set to retire, costing him significant retirement benefits. The termination came after the Justice Department inspector general found that McCabe made an unauthorized disclosure to the media, then lied to investigators about it.

“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,” the lawsuit alleges, adding that McCabe’s firing “was a critical element of Trump’s plan and scheme.”

Justice Department and FBI spokeswomen declined to comment. White House officials did not immediately respond to a message seeking comment.

The inspector general referred McCabe’s case to the U.S. Attorney’s Office in Washington, which has been using a grand jury to determine if McCabe should also be charged criminally. McCabe has long asserted he did nothing wrong, and that his termination, ordered by then-Attorney General Jeff Sessions, was a politically motivated effort by Trump to undermine the FBI’s work. Trump had vigorously criticized McCabe even before he was removed from his post.

The suit is the second this week by former FBI officials who say they were wrongly removed from their positions for political reasons.

On Tuesday, former FBI agent Peter Strzok, who also played a key role in the Russia probe, sued the Justice Department and FBI for reinstatement and back pay, arguing he was unfairly terminated for criticizing Trump. Strzok was found to have sent anti-Trump text messages, which FBI Deputy Director David Bowdich said called into question the bureau’s decisions in the Russia probe and the separate investigation of Hillary Clinton’s use of a private email server while she was secretary of state.

McCabe’s lawsuit is notable for its forcefulness, alleging that Trump enlisted the highest-ranking members of the federal law enforcement apparatus in a scheme to stifle dissent. The suit singles out in particular Sessions and FBI Director Christopher A. Wray, who it claims “knowingly acted in furtherance of Trump’s plan and scheme, with knowledge that they were implementing Trump’s unconstitutional motivations for removing Plaintiff from the civil service.”

After he was fired, McCabe wrote a book about his time in the FBI, which detailed his uncomfortable and unusual interactions with Trump and Sessions. He also raised more than $538,000 on a GoFundMe page set up for his legal defense.