Washington: Peter Strzok, the FBI senior counter-intelligence agent who disparaged President Donald Trump in inflammatory text messages and helped oversee the Hillary Clinton email and Russia investigations, has been fired for violating bureau policies, Strzok’s lawyer said on Monday.

Trump and his allies seized on the texts — exchanged during the 2016 campaign with a former FBI lawyer, Lisa Page — in assailing the Russia investigation as an illegitimate “witch hunt.” Strzok, who rose over 20 years at the FBI to become one of its most experienced counter-intelligence agents, was a key figure in the early months of the inquiry.

Along with writing the texts, Strzok was accused of sending a highly sensitive search warrant to his personal email account.

The FBI had been under immense political pressure by Trump to dismiss Strzok, who was removed last summer from the staff of special counsel Robert Mueller. The president has repeatedly denounced Strzok in posts on Twitter and on Monday expressed satisfaction that he had been sacked.

“Agent Peter Strzok was just fired from the FBI — finally. The list of bad players in the FBI & DOJ gets longer & longer. Based on the fact that Strzok was in charge of the Witch Hunt, will it be dropped? It is a total Hoax. No Collusion, No Obstruction — I just fight back!” Trump wrote.

He continued, “Just fired Agent Strzok, formerly of the FBI, was in charge of the Crooked Hillary Clinton sham investigation. It was a total fraud on the American public and should be properly redone!”

Trump’s victory traces back to June, when Strzok’s conduct was laid out in a wide-ranging inspector general’s report on how the FBI handled the investigation of Hillary Clinton’s emails in the run-up to the 2016 election. The report was critical of Strzok’s conduct in sending the texts, and the bureau’s Office of Professional Responsibility said that Strzok should be suspended for 60 days and demoted. Strzok had testified before the House in July about how he had not allowed his political views to interfere with the investigations he was overseeing.

But Strzok’s lawyer said the deputy director of the FBI, David Bowdich, had overruled the Office of Professional Responsibility and fired Strzok.

A spokeswoman for the FBI did not respond to a message seeking comment about why Strzok was dismissed rather than demoted. Firing Strzok, however, removes a favourite target of Trump from the ranks of the FBI and gives Bowdich and the FBI director, Christopher Wray, a chance to move beyond the president’s ire.

Aitan Goelman, Strzok’s lawyer, denounced his client’s dismissal. “The decision to fire Special Agent Strzok is not only a departure from typical bureau practice, but also contradicts Director Wray’s testimony to Congress and his assurances that the FBI intended to follow its regular process in this and all personnel matters,” Goelman said.

“This decision should be deeply troubling to all Americans,” Goelman added. “A lengthy investigation and multiple rounds of congressional testimony failed to produce a shred of evidence that Special Agent Strzok’s personal views ever affected his work.”

Strzok’s text exchanges with Page demonstrated animosity toward Trump. In one, Page asks: Trump is “not ever going to become president, right? Right?!” Strzok responds: “No. No he won’t. We’ll stop it.” The inspector general, who uncovered the messages, found no evidence that the pair imposed their political views on their investigative decisions but cited that exchange as “not only indicative of a biased state of mind but, even more seriously, implies a willingness to take official action to impact the presidential candidate’s electoral prospects.”

The report by the inspector general, Michael E. Horowitz, that preceded Strzok’s firing not only criticised his conduct in sending the texts but also his use of personal email accounts to handle sensitive information. In addition, the inspector general criticised Strzok’s decision not to move swiftly to examine new emails related to the Clinton investigation just weeks before the 2016 election.

Horowitz said in his report that he was “deeply troubled” by the text messages. Hundreds exchanged over months were found in which the pair disparaged Trump and, to a lesser extent, Clinton, exchanged work gossip and bantered.

On Twitter, Strzok said he was “deeply saddened by this decision,” adding, “It has been an honour to serve my country and work with the fine men and women of the FBI.”

Strzok became emblematic of Trump’s unfounded assertions that a so-called deep state of bureaucrats opposed to him was undermining his presidency. Trump contended that Strzok targeted the president and accused Strzok of being “treasonous” and a “disgrace.” Strzok told lawmakers that he never leaked information about the Russia inquiry, which could have upended the election and hurt Trump’s chances of becoming president.

After Horowitz uncovered the texts, Mueller, who had by then taken over the investigation, removed Strzok from his team. He was reassigned to the FBI’s human resources division. Page, who had left Mueller’s team before the discovery of the text messages, quit the FBI in May.

In a heated congressional hearing last month, Strzok expressed “significant regret” for the texts and rebutted the president’s attacks on the Russia inquiry. “This investigation is not politically motivated; it is not a witch hunt; it is not a hoax,” he said.

Strzok’s dismissal was not unexpected. He is the second senior FBI agent to be fired as a result of the inspector general’s investigation. In March, Andrew McCabe, the former deputy director, was fired after the inspector general repeatedly faulted him for misleading investigators.

The firing was politically motivated, McCabe has said, as an effort to discredit him as a witness in the special counsel investigation.

Both men were fired before they were eligible for their pension and health benefits.

Strzok, 48, a graduate of Georgetown University, served as an officer in the Army before he joined the FBI. He held several key positions in the FBI, eventually becoming a top deputy in the counter-intelligence division.

He handled many important espionage cases, including one involving a former CIA officer suspected of working for China and a group of Russian spies who had been working undercover in the United States.