FBI's deputy director stepping down amid repeated criticism from Trump Andrew McCabe had long been expected to retire from government in March.

 -- Two government officials familiar with the matter confirm to ABC News that FBI Deputy Director Andrew McCabe is stepping down immediately.

He had long been expected to retire from government in March, when he was eligible to receive his benefits for his years of service. Now, he is vacating his post atop the FBI and taking time away from the agency — but he will technically remain an employee of the bureau until his official retirement in March.

McCabe's role in the FBI has been the topic of conversation recently, as last week two sources familiar with the matter told ABC News that Attorney General Jeff Sessions has been pushing FBI Director Chris Wray to replace McCabe, his deputy, and install new leadership within the FBI.

A source familiar with McCabe’s thinking told ABC News that the deputy director in recent days had come to learn he was going to get “slammed” in an upcoming inspector general report on the actions of senior FBI officials during the 2016 presidential campaign.

It was going to be “rough on him,” the source said.

The attorney general’s push came as many Republicans, including President Donald Trump, continued to hammer McCabe and others at the FBI for what they allege is political bias in their law enforcement work.

Former FBI Director James Comey, known to be an ally of McCabe, reacted to the sudden departure in a statement on Twitter Monday.

“Special Agent Andrew McCabe stood tall over the last 8 months, when small people were trying to tear down an institution we all depend on,” Comey said. “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.”

Prior to Comey's dismissal in May 2017, Comey had come under fire for his handling of the investigation into Hillary Clinton’s use of a private email server, which ultimately exonerated Clinton of criminal wrongdoing.

More recently, McCabe has been under fire himself for alleged conflicts of interest because his wife ran for state-wide office as a Democrat in 2015 while the Clinton email probe was underway.

However, emails and correspondence released by the FBI show McCabe recused himself from any public corruption cases ties to Virginia. According to the FBI documents, McCabe had no oversight of the Clinton matter until he became deputy director in February 2016, three months after his wife lost her election bid.

Last month, Trump singled out McCabe in a tweet, writing, "How can FBI Deputy Director Andrew McCabe, the man in charge, along with leakin' James Comey, of the Phony Hillary Clinton investigation (including her 33,000 illegally deleted emails) be given $700,000 for wife's campaign by Clinton Puppets during investigation?"

White House Press Secretary Sarah Sanders said on Monday that the president didn’t have any involvement in the decision.

“The president wasn't a part of the decision-making process,” Sanders said.

As for whether anyone in the White House was in contact with the FBI on the matter, Sanders said she was not aware of any such contact.

Sources familiar with the matter told ABC News that President Trump called McCabe's wife a "loser" and expressed his anger about allowing fired Director James Comey to fly back on an FBI plane in a phone conversation the day after Comey's dismissal. NBC News first reported the exchange.

ABC News has reached out, but has not received, a response to request for comment from the White House.

Former Attorney General Eric Holder tweeted in defense of McCabe shortly after the news broke, calling him a "dedicated public servant" and warned of the impact that "bogus attacks on the FBI and Department of Justice can have long-term.

"FBI Deputy Director Andrew McCabe is, and has been, a dedicated public servant who has served this country well. Bogus attacks on the FBI and DOJ to distract attention from a legitimate criminal inquiry does long term, unnecessary damage to these foundations of our government," Holder wrote in a tweet.

FBI Deputy Director Andrew McCabe is, and has been, a dedicated public servant who has served this country well. Bogus attacks on the FBI and DOJ to distract attention from a legitimate criminal inquiry does long term, unnecessary damage to these foundations of our government. — Eric Holder (@EricHolder) January 29, 2018

The president's eldest son Donald Trump Jr. was critical of McCabe formally remaining in the bureau until March when he is eligible to receive his benefits for his years of service.

"So they will keep him on till then despite all this to make sure the American tax payer is stuck paying him for the rest of his life?" Trump Jr. wrote on Twitter.

So they will keep him on till then despite all this to make sure the American tax payer is stuck paying him for the rest of his life? https://t.co/5MVh9xAUxR — Donald Trump Jr. (@DonaldJTrumpJr) January 29, 2018

ABC News' Meghan Keneally, Josh Margolin, and Jordyn Phelps contributed to this report.

So they will keep him on till then despite all this to make sure the American tax payer is stuck paying him for the rest of his life? https://t.co/5MVh9xAUxR

ABC News' Meghan Keneally, Josh Margolin, and Jordyn Phelps contributed to this report.