Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — Attorney General Jeff Sessions late Friday night accepted the recommendation that former FBI Deputy Director Andrew McCabe, who took the reins of the agency during the turbulent days after the abrupt firing of James Comey, be terminated — two days before he was to retire and become eligible for full pension benefits.

Though McCabe — who has been attacked by President Donald Trump — stepped down as deputy director in late January, he remained on the federal payroll, planning to retire on Sunday. The firing places his federal pension in jeopardy.

Unlike Trump's removal of Comey last year, which produced widespread resentment inside the FBI, McCabe's termination was recommended by the agency he served for 21 years.

Sunday is McCabe's 50th birthday, which would have made him eligible for certain substantial retirement benefits.

Related: McCabe: Trump wants to destroy me to stop Mueller probe

The FBI's Office of Professional Responsibility proposed the termination, based on the findings of the Justice Department's inspector general. That office has been examining the bureau's handling of the Clinton e-mail investigation.

"After an extensive and fair investigation and according to Department of Justice procedure, the Department’s Office of the Inspector General provided its report on allegations of misconduct by Andrew McCabe to the FBI’s Office of Professional Responsibility," Sessions said in a statement at about 10 p.m. ET Friday night. "The FBI’s OPR then reviewed the report and underlying documents and issued a disciplinary proposal recommending the dismissal of Mr. McCabe. Both the OIG and FBI OPR reports concluded that Mr. McCabe had made an unauthorized disclosure to the news media and lacked candor — including under oath — on multiple occasions."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

In statement released after the firing was announced, McCabe said: "This attack on my credibility is one part of a larger effort not just to slander me personally, but to taint the FBI, law enforcement, and intelligence professionals more generally. It is part of this Administration’s ongoing war on the FBI and the efforts of the Special Counsel investigation, which continue to this day. Their persistence in this campaign only highlights the importance of the Special Counsel’s work."

Related: Read McCabe's full statement after firing

As part of the inquiry, McCabe was questioned about conversations FBI officials had with a reporter in October 2016 regarding the FBI's investigation of the Clinton Foundation. The inspector general's report, which has not been made public, concluded that McCabe was not completely candid in answering questions about those conversations, according to officials familiar with the report.

The findings of the inspector general apparently played a role in McCabe's decision to step down in late January from the deputy director post.

In a message to employees at the time, FBI Director Christopher Wray said, "It would be inappropriate for me to comment on specific aspects of the IG's review right now. But I can assure you that I remain staunchly committed to doing this job, in every respect, 'by the book.' I will not be swayed by political or other pressure in my decision making."

After Comey was fired in May 2017, McCabe became the FBI's acting director. Two days later, he was asked at a congressional hearing if the shake-up was affecting operations.

"Quite simply put, sir, you cannot stop the men and women of the FBI from doing the right thing, protecting the American people, and upholding the Constitution," he replied, a comment that cheered the FBI's rank and file.

But McCabe became a target of Republicans who questioned the FBI's impartiality in how the Clinton investigation was conducted.

When McCabe's wife, Jill, ran for the state Senate in Virginia in 2015, she accepted a donation from a political action committee controlled by Gov. Terry McAuliffe, a friend and supporter of Hillary Clinton's — and that became the basis for a series of Twitter attacks from Trump.

"Problem is that the acting head of the FBI & the person in charge of the Hillary investigation, Andrew McCabe, got $700,000 from H for wife!" Trump wrote in July 2017, erroneously claiming that McCabe had a role in facilitating the contribution.

FBI Deputy Director Andrew McCabe is racing the clock to retire with full benefits. 90 days to go?!!! — Donald J. Trump (@realDonaldTrump) December 23, 2017

The next day, the president asked in a tweet, "Why didn't [Attorney General] Sessions replace Acting FBI Director Andrew McCabe, a Comey friend who was in charge of the Clinton investigation?"

Trump tweeted a shot at McCabe early Saturday, minutes after midnight.

"Andrew McCabe FIRED, a great day for the hard working men and women of the FBI - A great day for Democracy. Sanctimonious James Comey was his boss and made McCabe look like a choirboy. He knew all about the lies and corruption going on at the highest levels of the FBI!" the president claimed.

In response to criticism that McCabe should not have played a role in the Clinton investigation, the FBI said he consulted with internal ethics officials who concluded that because his wife's campaign ended before the investigation began, there was no conflict.

The number-two official at the FBI is now Acting Deputy Director David Bowdich, who supervised the investigation of the deadly 2015 shooting at the San Bernardino, California, community center.