Strzok initially helped lead the bureau's investigation into Russian interference in the 2016 elections and possible complicity by the Trump campaign.

WASHINGTON — Peter Strzok, the FBI agent whose anti-Trump text messages to a colleague during the 2016 campaign have been cited by the president as evidence of bias within the agency, has been fired.

Strzok initially helped lead the bureau's investigation into Russian interference in the 2016 elections and possible complicity by the Trump campaign, which remained secret until after the election. When his texts with an FBI lawyer, Lisa Page, were disclosed last year by the agency's inspector general, special counsel Robert S. Mueller immediately removed Strzok from the team.

Strzok had initially been demoted and given a 60-day suspension after the bureau's traditional independent review. But on Friday, FBI Deputy Director David L. Bowdich overrode that decision and ordered his firing, according to Strzok's attorney, Aitan Goelman.

"This decision should be deeply troubling to all Americans," Goelman said in a statement. "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."

The FBI has not responded to a request for comment.

The firing of Strzok, a 22-year FBI veteran and one of its senior counterintelligence agents, is an unexpected turn of events for him, but in keeping with FBI Director Christopher A. Wray's promise back in June to "hold people accountable."

The decision to fire him — in the wake of repeated attacks on Strzok by the president and his allies in Congress, who cheered the news — will do little to quell widespread concerns that the agency and the Department of Justice may not be acting independent of politics.

Strzok's lawyer was quick to hit that theme.

"In his decades of service, Special Agent Strzok has proved himself to be one of the country's top counterintelligence officers," Goelman said in his statement. Strzok's firing, he said, leads "to only one conclusion — the decision to terminate was taken in response to political pressure, and to punish Special Agent Strzok for political speech protected by the First Amendment, not on a fair and independent examination of the facts."

Trump, who just Saturday tweeted that Strzok was among the "clowns and losers" at the FBI, on Monday weighed in on Twitter to applaud the firing, and again to paint the Russia probe as a hoax.

"Agent Peter Strzok was just fired from the FBI — finally," Trump tweeted. "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!"

When FBI Inspector Gen. Michael E. Horowitz told Mueller last summer that Strzok, then the lead agent on his team, had been exchanging anti-Trump messages with Page, Mueller removed Strzok the following day. That did not satisfy the president and his defenders, who have sought to focus the public's attention on Strzok and Page, who had a romantic relationship, to discredit the broader investigation.

Trump has mocked the pair as "FBI lovers." Page, who had left the Mueller team before the texts became public, resigned from the FBI in May.

"Will the FBI ever recover it's (sic) once stellar reputation, so badly damaged by Comey, McCabe, Peter S and his lover, the lovely Lisa Page, and other top officials now dismissed or fired?" Trump wrote on Saturday, referring also to former FBI Director James B. Comey and Comey's deputy, Andrew McCabe, both of whom were fired.

"So many of the great men and women of the FBI have been hurt by these clowns and losers!" Trump added.

Strzok, who was a deputy assistant director for counterintelligence at the bureau, has apologized for sending the messages and testified before Congress that they reflected personal views that did not affect his work. The text messages included criticism of Hillary Clinton.

Even so, Horowitz concluded that Strzok showed a "willingness to take official action" to hurt Trump's electoral prospects, particularly in a text he sent telling Page "we'll stop" Trump from being president.

Strzok's lawyer has said that if his client had wanted to prevent Trump's election, he could have leaked that the Trump campaign was under investigation for possibly coordinating with Russia.

Last month, Strzok sparred with Republican lawmakers who raised questions about his character during a contentious hearing on Capitol Hill. He stated that there was "no evidence of bias in my professional actions" and claimed that his demotion was done "based on the appearance" of bias, a point Republican lawmakers refused to accept.

Several of the Republicans joined Trump on Twitter Monday to laud Strzok's ouster. "It's about time," wrote Rep. Jim Jordan of Ohio. "Long overdue," tweeted House Majority Leader Kevin McCarthy, of California.

In June, Strzok was escorted out of the FBI building and effectively relieved of work responsibilities, although he technically remained an employee as he and his attorney challenged the effort to dismiss him.

On July 24, they made a final pitch to Candice M. Will, who leads the FBI's office of professional responsibility. Will decided that Strzok receive the demotion and 60-day suspension as part of a "last chance agreement," according to Goelman.

But, Goelman said, Bowdich overruled that decision and Strzok was fired.

Mark Zaid, a lawyer in Washington who has represented a number of FBI agents over the years, said Bowditch's decision to overrule Will's disciplinary action is highly unusual and will inevitably be viewed as a reaction to political pressure from the president. That could strengthen Strzok's case should he challenge his firing in court, Zaid added.

"Those cases are hard to win," he said, but Strzok could "have a stronger case than most."

"When the president is tweeting that he should be fired and then he is, it seems pretty obvious that his attorney can reasonably ask the question of what role those tweets may have played."