Fired FBI chief James Comey was already plotting to share memos summarizing his conversations with President Trump with a pal who later leaked the info to the media before his supposed middle-of-the night epiphany about the president’s claim that he had “tapes” of their conversations.

The discrepancies in his timeline, as outlined in the Justice Department’s top watchdog’s scathing, 83-page report on his behavior, create more uncertainty about Comey’s version of events following his May 9, 2017, ouster.

The former top G-man told investigators for Inspector General Michael Horowitz, and a key Senate committee during an earlier hearing, that Trump’s Friday, May 12, 2017, tweet about supposed Oval Office “tapes” caused him to snap awake “in the middle of the night” the following Monday, May 15, and conclude that he needed to share the records.

“James Comey better hope that there are no ‘tapes’ of our conversations before he starts leaking to the press!” the president had tweeted.

But Horowitz’s report — which concluded that Comey had violated department policies — said that on the afternoon of Sunday, May 14, 2017 — the day before he said the midnight lightning bolt struck — Comey had already sent four of the memos to Patrick Fitzgerald, one of his lawyers, “with instructions to share the email and PDF attachment with [lawyer David] Kelley and professor [Daniel] Richman.” The discrepancy was first reported by Fox News.

Richman, a longtime Comey pal and professor at Columbia Law School, leaked the memos days later to the New York Times, which published a story about Comey’s allegation that the president asked him to go easy on former national security adviser Michael Flynn.

Comey had also testified before the Senate Select Committee on Intelligence in June 2017 that the late-night awakening had happened on the Monday after Trump’s tweet, according to the IG’s report.

“The president tweeted on Friday [May 12], after I got fired, that I better hope there’s not tapes. I woke up in the middle of the night on Monday night, because it didn’t dawn on me originally that there might be corroboration for our conversation. There might be a tape,” Comey said in response to questions from Maine GOP Sen. Susan Collins.

“And my judgment was, I needed to get that out into the public square. And so I asked a friend of mine to share the content of the memo with a reporter. Didn’t do it myself, for a variety of reasons. But I asked him to, because I thought that might prompt the appointment of a special counsel. And so I asked a friend of mine to do it,” he said, referring to Richman.

Comey hoped that the special counsel would prevent the president or his team from destroying any such tapes, which he believed would verify his version of his conversation with Trump.

Fitzgerald forwarded Comey’s documents to Kelley at 7:35 a.m. May 17, and to Richman at 10:13 a.m. May 17.

But Comey himself sent a digital photograph of one of his memos to Richman on Tuesday, May 16 — the day after the supposed epiphany — and told him to share the contents with the Times.

Horowitz’s damning report concluded that Comey breached bureau policy by stashing and leaking the memos of private conversations he had with the commander-in-chief.

His undercover attempt to “achieve a personally desired outcome” established a troubling precedent at the FBI, Horowitz wrote in a summary of his findings issued Thursday.

“By not safeguarding sensitive information obtained during the course of his FBI employment, and by using it to create public pressure for official action, Comey set a dangerous example for the over 35,000 current FBI employees,” Horowitz wrote.

Comey, whom the Justice Department declined to prosecute, claimed that the IG’s report vindicated him because it showed he did not leak any classified material, as Trump had claimed.