Former FBI deputy director Andrew McCabe kept personal memos regarding US President Donald Trump that are similar to the notes compiled by dismissed FBI chief James Comey detailing interactions with him, the Associated Press has learned.

Mr McCabe was long scorned by Mr Trump and was fired by attorney general Jeff Sessions on Friday.

It was not immediately clear whether any of Mr McCabe’s memos have been turned over to or been requested by special counsel Robert Mueller, whose criminal investigation is examining Trump campaign ties to Russia and possible obstruction of justice.

Mr McCabe’s memos include details of interactions with the president, among other topics, according to a source.

The disclosure on Saturday came hours after Mr Trump called Mr McCabe’s firing by Mr Sessions a “great day for democracy”.

Mr Sessions, acting on the recommendation of FBI disciplinary officials, acted two days before Mr McCabe’s scheduled retirement date.

Mr McCabe suggested the move was part of the Trump administration’s “war on the FBI”.

Mr Trump tweeted in praise of Mr Sessions’s announcement on Friday night, asserting without elaboration that Mr McCabe “knew all about the lies and corruption going on at the highest levels of the FBI!”

An upcoming inspector general’s report is expected to conclude that Mr McCabe, a Comey confidant, authorised the release of information to the media and was not forthcoming with the watchdog office as it examined the bureau’s handling of the Hillary Clinton email investigation.

“The FBI expects every employee to adhere to the highest standards of honesty, integrity, and accountability,” Mr Sessions said in a statement.

Mr McCabe said his credibility had been attacked as “part of a larger effort not just to slander me personally” but also the FBI and law enforcement.

“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,” he added, referring to Mr Mueller’s probe into potential co-ordination between Russia and the Trump campaign.

“Their persistence in this campaign only highlights the importance of the special counsel’s work.”

Mr Trump’s personal lawyer John Dowd cited the “brilliant and courageous example” by Mr Sessions and the FBI’s Office of Professional Responsibility and said in a statement on Saturday that the number two Justice Department official, Rod Rosenstein, should “bring an end” to the Russia investigation “manufactured” by Mr Comey.

Mr Dowd told the Associated Press that he was neither calling on Mr Rosenstein, the deputy attorney general overseeing Mr Mueller’s inquiry, to fire the special counsel immediately nor had discussed with Mr Rosenstein the idea of dismissing Mr Mueller or ending the probe.

Mr McCabe asserted he was singled out because of the “role I played, the actions I took, and the events I witnessed in the aftermath” of Mr Comey’s firing by Mr Trump last May.

Mr Mueller is investigating whether Mr Trump’s actions, including Mr Comey’s dismissal, constitute obstruction of justice. Mr McCabe could be an important witness.

Mr Trump, in his tweet early on Saturday, said Mr McCabe’s firing was “a great day for the hard working men and women of the FBI – A great day for Democracy”.

He said “Sanctimonious James Comey”, as Mr McCabe’s boss, made Mr McCabe “look like a choirboy”.

Mr McCabe said the release of the findings against him was accelerated after he told congressional officials that he could corroborate Mr Comey’s accounts of Mr Comey’s conversations with the president.

Mr McCabe spent more than 20 years as a career FBI official and played key roles in some of the bureau’s most recent significant investigations.

Mr Trump repeatedly condemned him over the past year as emblematic of an FBI leadership he contends is biased against his administration.

Mr McCabe had been on leave from the FBI since January, when he abruptly left the deputy director position.

He had planned to retire on Sunday and the dismissal probably jeopardises his ability to collect his full pension benefits.

His removal could add to the turmoil that has enveloped the FBI since Mr Comey’s firing and as the FBI continues its Trump campaign investigation that the White House has dismissed as a hoax.

The firing arises from an inspector general review into how the FBI handled the Clinton email investigation.

That inquiry focused not only on specific decisions made by FBI leadership but also on news media leaks.

Mr McCabe came under scrutiny over an October 2016 news report that revealed differing approaches within the FBI and Justice Department over how aggressively the Clinton Foundation should be investigated.

The watchdog office has concluded that Mr McCabe authorised FBI officials to speak to a Wall Street Journal reporter for that story and that Mr McCabe had not been forthcoming with investigators. Mr McCabe denies it.

In his statement, Mr McCabe said he had the authority to share information with journalists through the public affairs office, a practice he said was common and continued under the current FBI director Christopher Wray.

Mr McCabe said he honestly answered questions about whom he had spoken to and when, and that when he thought his answers were misunderstood, he contacted investigators to correct them.

The media outreach came at a time when Mr McCabe said he was facing public accusations of partisanship and followed reports that his wife, during a run for the state senate in Virginia, had received campaign contributions from a Clinton ally.

Mr McCabe suggested in his statement that he was trying to “set the record straight” about the FBI’s independence against the background of those allegations.

With the FBI disciplinarians recommending the firing, Justice Department leaders were in a difficult situation.

Mr Sessions, whose job status has for months appeared shaky under his own blistering criticism from Mr Trump, risked inflaming the White House if he decided against firing Mr McCabe.

But a decision to dismiss Mr McCabe days before his retirement nonetheless carried the risk of angering his rank-and-file supporters at the FBI.

Mr McCabe became entangled in presidential politics in 2016 when it was revealed that his wife, during her unsuccessful legislative run, received campaign contributions from the political action committee of then-Virginia governor Terry McAuliffe, a longtime Clinton friend.

The FBI has said Mr McCabe received the necessary ethics approval about his wife’s candidacy and was not supervising the Clinton investigation at the time.

He became acting director following the firing last May of Mr Comey and immediately assumed direct oversight of the FBI’s investigation into the Trump campaign.

He quickly found himself at odds with the Trump administration.