Image copyright AFP/Getty Image caption Mr McCabe has spent most of his career working at the FBI

Former FBI deputy director Andrew McCabe has been sacked days before he could retire with pension rights.

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.

US media say he has kept notes of his interactions with the president.

If so, they may become part of the inquiry.

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?!!!"

Why was McCabe fired?

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.

Image copyright Reuters Image caption Mr Sessions has been under pressure to decide Mr McCabe's fate ahead of his retirement

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".

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".

Media playback is unsupported on your device Media caption The former director's most revealing moments

"The big picture is a tale of what can happen when law enforcement is politicized," he went on to say.

"Here is the reality: I am being singled out and treated this way because of the role I played, the actions I took, and the events I witnessed in the aftermath of the firing of James Comey."

Mr Comey was fired as head of the FBI in May last year by the president, who cited his handling of the Clinton email investigation but later acknowledged "this Russia thing" was part of the reason.

Mr Comey had been leading the FBI's investigation into allegations of collusion between Trump campaign officials and Russian interference in the vote. He later told a Senate hearing that the president had asked for his "loyalty".

Mr McCabe alleges that the release of the justice department report recommending his firing was "accelerated" after he indicated that he would corroborate Mr Comey's version of events.

Why did Trump object to McCabe?

Mr Trump has been a frequent critic of Mr McCabe, whom he accuses of political bias in his roles in the Russia and Clinton email investigations.

He has publicly pointed to donations that Mr McCabe's wife Jill, a Democrat, received from a Clinton ally when she ran unsuccessfully for the state Senate in Virginia in 2015.

Image copyright Getty Images Image caption The White House said it was for the attorney general, not President Trump, to fire Mr McCabe

After James Comey was fired, Mr McCabe became acting director of the FBI. Mr Trump reportedly invited him to the Oval Office and asked him who he voted for in the 2016 election.

Mr McCabe, in his statement on Friday, said he and his family had been the targets of an "unrelenting assault" in the media to undermine his reputation, and said Mr Trump's tweets had "amplified and exacerbated it all".

Citing anonymous sources on Saturday, the Associated Press news agency says Mr McCabe has kept memos of his meetings with Mr Trump. It is not clear whether they have been handed over to the special counsel leading the inquiry, Robert Mueller.

Mr Comey also kept contemporaneous notes of his encounters with Mr Trump.

Why has it happened now?

Mr McCabe had been with the FBI for two decades and was due to retire on Sunday, the day he turns 50 and can claim his federal government pension.

It is not clear how much of his pension he might lose as a result of Mr Sessions' announcement.

White House spokeswoman Sarah Huckabee Sanders on Thursday said it was for the attorney general to decide Mr McCabe's future.

"But," she added, "we do think it is well documented that he has had some very troubling behaviour and by most accounts a bad actor and should have some cause for concern."