Former FBI Director James Comey shamelessly breached basic bureau policy by stashing and leaking memos of private conversations he had with President Trump, a scathing report by Department of Justice investigators has found.

The ousted G-man’s undercover attempt to “achieve a personally desired outcome” established a troubling precedent at the FBI, DOJ Inspector General Michael Horowitz wrote in a summary of his findings issued on 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.

At the heart of the rebuke was Comey’s leaking to The New York Times, by way of a lawyer friend, a document identified as “Memo 4,” which recounts a one-on-one meeting in which Trump purportedly asked the FBI director to let his embattled former national security adviser, Michael Flynn, off the hook.

In that Oval Office sit-down on Valentine’s Day 2017 — one day after Flynn resigned amid scrutiny over his back-channel conversations with Russian operatives — Trump told the then-FBI director, “I hope you can see your way clear to letting this go, to letting Flynn go,” according to the memo.

Memo 4, which was designated “For Official Use Only” but not considered classified, stayed private until May 16, 2017 — a week after Comey’s firing from the FBI.

On that day, Comey texted photos of its two pages to Daniel Richman, a pal and one of Comey’s personal lawyers, with the understanding that Richman would relay its contents to a Times reporter.

By day’s end, the memo was the basis of a bombshell story in the broadsheet, pouring fuel on the raging fire of the Russia probe.

“Members of Comey’s senior leadership team used the adjectives ‘surprised,’ ‘stunned,’ ‘shocked’ and ‘disappointment’ to describe their reactions to learning that Comey acted on his own to provide the contents of Memo 4, through Richman, to a reporter,” the inspector general wrote.

Memo 4 was among seven written records Comey made between January 2017 and April 2017 of meetings and phone calls with Trump and members of his inner circle.

After his ouster, Comey retained four of the memos, including Memo 4, in a personal home safe, unbeknownst to the FBI. The three others were left with the bureau.

Two days before the leak of Memo 4 to the Times, Comey e-mailed scanned copies of it, as well as the three other retained memos — referred to as Memos 2, 6 and 7 — to his legal team.

Memos 2, 6 and 7 recount a face-to-face meeting in which Trump purportedly demanded “loyalty” of Comey, as well as two phone calls in which the president asked Comey to help lift the “cloud” of the Russia investigation.

In an interview with Horowitz for his investigation, Comey tried to justify his squirreling away of the documents by considering them “personal records rather than FBI records,” according to the report.

That argument, Horowitz wrote, “finds no support in the law and is wholly incompatible with . . . the terms of Comey’s FBI Employment Agreement.”

Comey added that he went rogue out of a “love” for his country, the DOJ and the FBI — a notion Horowitz called misguided at best.

“Were current or former FBI employees to follow the former director’s example and disclose sensitive information in service of their own strongly held personal convictions, the FBI would be unable to dispatch its law-enforcement duties properly,” the inspector general wrote.

Horowitz had referred Comey for potential prosecution, but the DOJ declined to bring charges.

Comey curiously claimed victory after the report’s release.

“I don’t need a public apology from those who defamed me, but a quick message with a ‘sorry we lied about you’ would be nice,” he tweeted.

“And to all those who’ve spent two years talking about me ‘going to jail’ or being a ‘liar and a leaker’ — ask yourselves why you still trust people who gave you bad info for so long, including the president,” he said in another tweet.

The next shoe to drop may be the conclusion of an inquiry by John Durham, a Connecticut federal prosecutor tasked by Attorney General William Barr to examine the origins of the Russia investigation.