WASHINGTON (Reuters) - Former top FBI official Andrew McCabe, who was dismissed from the agency following a tumultuous relationship with President Donald Trump, filed a lawsuit on Thursday alleging the termination violated his constitutional rights to free speech and due process.

The lawsuit, filed in federal court in Washington, urged a judge to order the reinstatement of “his full earned law enforcement pension, healthcare insurance, and other retirement benefits.”

McCabe said in the complaint that his firing was “unlawful retaliation for his refusal to pledge allegiance” to Trump.

The lawsuit followed a similar one by former high-ranking FBI agent Peter Strzok, who came under fire from Trump and other Republicans for sending text messages that disparaged Trump during the presidential campaign.

McCabe, the law enforcement agency’s former No. 2 official, played a crucial role in the bureau’s investigations of Hillary Clinton and Russian interference in the 2016 U.S. election.

Trump and other Republicans accused McCabe, a lifelong Republican who worked at the FBI for more than 20 years, of political bias and conflicts in connection with his oversight of investigations related to Clinton.

McCabe has denied the accusations and charged that he was facing retaliation from the Trump administration.

Some of the criticism stemmed from the fact that his wife, Jill McCabe, a Democrat, received donations for an unsuccessful 2015 Virginia state senate campaign from an ally of Clinton’s.

Former Attorney General Jeff Sessions fired McCabe in March 2018, saying he felt justified in doing so after the Justice Department’s internal watchdog found he leaked information to reporters and misled investigators about his actions.

McCabe had stepped down from his position as FBI deputy director in January 2018 but remained on leave pending retirement.

McCabe has said he believes he was politically targeted because he corroborated former FBI Director James Comey’s claims that Trump tried to pressure Comey into killing the Russia probe.

McCabe was sacked two days before his 50th birthday, when he would have been eligible to retire from the FBI with his full pension.

McCabe published a book in February on the FBI’s efforts to safeguard the United States, which argued that Trump undermined the country’s security.