He was fired by US Attorney General Jeff Sessions, who said an internal review found he leaked information and misled investigators.
Mr McCabe denied the claims and said he was being targeted because of his involvement in the inquiry into alleged Russian meddling in the 2016 election.
Mr Trump has long accused Mr McCabe of bias in favour of the Democrats.
He immediately praised Mr Sessions’ decision to fire him.
In December, the president appeared to taunt the then number two at the FBI, when he tweeted: “FBI Deputy Director Andrew McCabe is racing the clock to retire with full benefits. 90 days to go?!!!”
Mr McCabe had been under an internal investigation into the FBI’s handling of two key inquiries during the 2016 presidential campaign – the revelations that Hillary Clinton had used a private email server while secretary of state and suspicions that Russia was interfering to help Mr Trump win the presidency.
He stepped down from his role as deputy director in January because of the review, and had remained on the FBI’s books ahead of his expected retirement.
His sacking came late on Friday night. Mr Sessions, who heads the justice department, said it was the result of “an extensive and fair investigation” by his department and the FBI.
Mr Sessions said the report had concluded that Mr McCabe had “made an unauthorised disclosure to the news media and lacked candour – including under oath – on multiple occasions”.
Who’s who in Russia-Trump inquiry?
Trump Russia: Key questions answered
What is Mueller’s special counsel?
The report has not been released but it is thought to refer to an interview Mr McCabe authorised between two FBI officials and a Wall Street Journal reporter in October 2016 to explain the agency’s position in the Clinton emails inquiry.
He was then subsequently interviewed by the justice department’s inspector general.
How did McCabe respond?
Mr McCabe has issued a lengthy statement vehemently rejecting the allegations against him and denouncing what he described as a campaign of attacks on his credibility.
He insisted he had done nothing wrong in organising the October 2016 interview, saying “it was the type of exchange with the media that the Deputy Director oversees several times per week”.
He said of the subsequent justice department investigation that he tried to answer the questions “truthfully and accurately” and “when I thought my answers were misunderstood, I contacted investigators to correct them”.