Mr. Trump seized on her campaign as proof that Mr. McCabe wanted to take him down while protecting Hillary Clinton, whom the F.B.I. had investigated for her use of a private email server. Mr. McCabe said on Friday that he was glad the investigation was over but feared Mr. Trump would never let up. “I don’t think I’ll ever be free of this president and his maniacal rage that he’s directed at me and my wife,” Mr. McCabe said on CNN. For more than two years, he said, Mr. Trump “for absolutely no reason whatsoever” has been “lying about us and defaming me and my family.”

When the president dismissed James B. Comey as F.B.I. director in 2017, he said it was in part for his decision to allow Mr. McCabe to be involved in the Clinton investigation, according to excerpts from a draft letter from the president to Mr. Comey that were read to The New York Times.

“Few events have represented a more profound breach of public trust than your decision to allow the Clinton email investigation to be overseen by deputy F.B.I. director Andrew McCabe, whose wife Jill McCabe received approximately $700,000 in campaign donations steered to her by a top Clinton surrogate,” Mr. Trump wrote. “McCabe should not have been allowed to work on this matter.”

Mr. Trump’s aides intervened and sent Mr. Comey a more toned-down letter explaining his dismissal.

But little evidence bears out the president’s view of Mr. McCabe. He oversaw the Clinton investigation as the bureau’s deputy director only after Mrs. McCabe lost her race, and the Wall Street Journal article about Mrs. Clinton late in the presidential campaign was more damaging to her than helpful.

In the months after the inspector general report, the president pushed for the firing of Mr. McCabe. “F.B.I. Deputy Director Andrew McCabe is racing the clock to retire with full benefits,” Mr. Trump tweeted in December 2017. “90 days to go?!!!”

Jeff Sessions, the attorney general at the time, dismissed Mr. McCabe hours before he was eligible for those benefits, a move many saw as vindictive. It was also a possible conflict of interest because Mr. McCabe had opened an investigation into Mr. Sessions after receiving a criminal referral from Congress suggesting that he had lied to lawmakers about his contacts with a Russian diplomat. The case was later closed.

Mr. McCabe spent 21 years in the F.B.I., beginning his career in New York investigating Russian organized crime. When terrorists struck the twin towers in the Sept. 11, 2001, attacks, Mr. McCabe deployed as a bureau SWAT team member. He later oversaw major international terrorism investigations and rose to run the bureau’s national security division and its Washington field office. He was promoted to deputy director in January 2016 after the Clinton email investigation was underway.