FBI Deputy Director Andrew McCabe — who became a symbol for President Trump of what he considers the bureau's political bias — abruptly stepped down Monday amid an internal probe examining his handling of the bureau's investigations into Hillary Clinton, according to people familiar with the matter.

McCabe's departure had been long anticipated, but the timing caught many by surprise. It followed what officials described as a private meeting with FBI Director Christopher A. Wray during which Wray expressed concern about the findings of an investigation by the Justice Department's inspector general, these people said. News of the meeting was first reported by the New York Times.

McCabe, 49, has been a lightning rod in the political battles surrounding special counsel Robert S. Mueller III's probe into whether any Trump associates coordinated with Russian agents to interfere in the 2016 presidential race. In a message to FBI staff, Wray said the FBI had followed procedures, not politics, leading up to McCabe's departure.

"My conviction to adhering to process is similarly matched by my conviction to holding people accountable,'' Wray wrote in the message, adding that it would be inappropriate to comment on the particulars of the inspector general's probe.

"I remain staunchly 'by the book,' " Wray wrote, adding that he "will not be swayed" by political pressure. "After discussions with our Deputy Director Andy Mc­Cabe, he submitted his intention to retire on March 18,'' the director wrote. "I'm very grateful to Andy for his years of dedicated, selfless and brave service to the FBI and the American people.''

White House press secretary Sarah Huckabee Sanders said Monday that the president "wasn't part of this decision-making process."

McCabe's former boss, former FBI director James B. Comey, defended him on Twitter Monday, saying he "stood tall over the last 8 months, when small people were trying to tear down an institution we all depend on. He served with distinction for two decades. I wish Andy well. I also wish continued strength for the rest of the FBI. America needs you.''

McCabe's departure had been expected, though the precise timing was unknown. As The Washington Post reported in late December, McCabe had planned to retire in March and use accrued vacation time to reach the date he becomes eligible for full pension benefits. On Monday, people close to the matter confirmed that McCabe's plan is unchanged. Technically, he will remain an FBI employee for the next several weeks, but he has left the deputy director position and is not expected to return to work, these people said.

David Bowdich, a senior FBI official who led the agency's response to the San Bernardino terrorist attack in 2015, has been named the FBI's acting No. 2 official, according to Wray's message.

In a separate message to FBI personnel, McCabe wrote that it was "with great sadness" that he was announcing his retirement. "You have the greatest mission on earth, protecting the American people and upholding the American constitution. . . . You speak up, you tell the truth and you do the right thing. Thank you for your service, your support, and your friendship.''

McCabe assumed the director's job on an acting basis after Comey was fired in May. The Post reported last week that the president asked McCabe in a private discussion whom he had voted for in the presidential election. Mc­Cabe responded that he had not voted, according to several current and former U.S. officials.

McCabe ran the FBI for three turbulent months last year, until Wray took over as director in August.

Trump's dislike for McCabe dates to October 2016, when news stories revealed that McCabe's wife, who had run as a Democrat for the Virginia legislature, received nearly $500,000 in donations from the political action committee of then-Gov. Terry McAuliffe (D) — a close ally of Hillary Clinton's — and that Mc­Cabe had gone on to oversee investigations involving Clinton.

After revelations that a stalled probe into the Clinton Foundation had led to infighting among FBI and Justice Department personnel — a feud in which McCabe played a role — he recused himself from Clinton-related matters days before the election.

In the campaign's final days, Trump often singled out McCabe for criticism. More recently, Mc­Cabe has been harshly criticized by congressional Republicans who challenge the FBI's rationale for opening the Russia probe in July 2016.

One of those critics, Rep. Matt Gaetz (R-Fla.), cheered McCabe's move Monday, calling it "a step forward."

"The past several weeks and months have seen worrisome evidence of bias and wrongdoing at the FBI come to light," Gaetz said.

Former attorney general Eric H. Holder Jr. called McCabe "a dedicated public servant who has served this country well." Holder, a Democrat, denounced "bogus attacks on the FBI and DOJ to distract attention from a legitimate criminal inquiry."

The political scrutiny surrounding McCabe intensified in December, when The Post reported that his senior adviser, Lisa Page, had been engaged in a romantic relationship with Peter Strzok, a senior FBI agent, and the two exchanged anti-Trump, pro-Clinton text messages while they were immersed in ongoing investigations of the two presidential candidates.

The Justice Department's inspector general continues to investigate the conduct of McCabe, Page, Strzok, Comey and others in their handling of the probe into Clinton's use of a private email server when she was secretary of state.

Jenna Johnson contributed to this report.