Former FBI deputy director Andrew McCabe kept personal memos describing interactions with President Donald Trump that are similar to the notes compiled by dismissed FBI chief James Comey, the Associated Press (AP) 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.

Though the precise contents are unknown, the memos could possibly help substantiate Mr McCabe’s assertion that he was unfairly maligned by a White House he says had declared “war” on the FBI and Mr Mueller’s investigation.

They almost certainly contain, as Mr Comey’s memos did, previously undisclosed details about encounters between the Trump administration and FBI.

The disclosure on Saturday came hours after Mr Trump called Mr McCabe’s firing by attorney general Jeff Sessions “a great day for democracy” and asserted without elaboration that Mr McCabe knew “all about the lies and corruption going on at the highest levels of the FBI!”

That sent former CIA director John Brennan, an outspoken Trump critic, into a Twitter tirade.

“When the full extent of your venality, moral turpitude, and political corruption becomes known, you will take your rightful place as a disgraced demagogue in the dustbin of history. You may scapegoat Andy McCabe, but you will not destroy America…America will triumph over you,” he tweeted.

Mr Sessions said he acted on the recommendation of FBI disciplinary officials who said Mr McCabe had not been candid with a watchdog office investigation.

Mr McCabe was fired two days before his retirement date.

An upcoming inspector general’s report is expected to conclude that Mr McCabe had 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.

Mr McCabe denied the allegations and 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.

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

The firing set off duelling tweets between Mr Trump, who called the termination a “great day for the hard working men and women of the FBI”, and Mr Comey, the director he fired 10 months ago.

Mr Trump called Mr Comey “sanctimonious” and said he made Mr McCabe “look like a choirboy”.

Mr Comey, whose highly anticipated book comes out next month, responded with his own tweet: “Mr. President, the American people will hear my story very soon. And they can judge for themselves who is honorable and who is not.”

Mr Trump’s personal lawyer John Dowd cited the “brilliant and courageous example” of Mr Sessions and the FBI’s Office of Professional Responsibility, and said deputy attorney general Rod Rosenstein should “bring an end” to the Russia investigation “manufactured” by Mr Comey.

Mr Dowd told the AP that he was neither calling on Mr Rosenstein, who oversees 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 Mueller is investigating whether Mr Trump’s actions, including Mr Comey’s dismissal, constitute obstruction of justice.

Mr McCabe could be an important witness, and his memos could be used by investigators as they look into whether Mr Trump sought to thwart the FBI probe.

Mr Comey’s own memos have been turned over to Mr Mueller and are part of his investigation.

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

Mr McCabe became acting director after that and assumed direct oversight of the FBI’s investigation into the Trump campaign.

He 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 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 dismissal and as the bureau moves ahead with an investigation the White House has dismissed as a hoax.

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

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

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.

Mr McCabe became entangled in presidential politics in 2016 when it was revealed that his wife, during her unsuccessful run for state senate in Virginia, received campaign contributions from the political action committee of then-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.