The U.S. Justice Department has decided not to prosecute former FBI director James Comey despite an internal investigation that found he improperly leaked information to the news media, the department's Office of Inspector General said Thursday.

The inspector general's office, which serves as the agency's internal watchdog, said Comey shared a handwritten memo with a friend — a law professor at Columbia University — who described it to the New York Times, in an effort by Comey to pressure the Justice Department to launch an independent investigation into his conversations with President Donald Trump.

The memo described a private conversation in which Trump allegedly asked Comey to drop the FBI's investigation into his then-national security adviser, Michael Flynn. Flynn has since pleaded guilty to lying to the FBI about his conversations with Russian officials.

Comey decided to share the contents of the memo after Trump fired him in May 2017.

The report, written by Inspector General Michael Horowitz, said that while that memo did not contain classified material, Comey set a dangerous example when he shared sensitive information to create public pressure for official action.

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

The department has already decided not to prosecute Comey over the matter.

The report concluded that Comey "set a dangerous example for the over 35,000 current FBI employees."

'Thoroughly disgraced and excoriated': Trump

The Justice Department's report is the latest development in an ongoing fight between Comey — who authorized opening an investigation in Trump's 2016 election campaign and ties with Russia that would go on in a new form with special counsel Robert Mueller's probe — and Trump, who contends that the investigation should never have begun.

Trump deemed Comey "thoroughly disgraced and excoriated" in a tweet Thursday.

Comey himself noted on Twitter that the inspector general found no evidence that he or his lawyers had ever shared any classified information with the news media.

"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," Comey wrote.

He also added: "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."

The reaction from those on Capitol Hill in the first hours after the release of the report came from the right.

Ohio congressman Jim Jordan said the report was "a disappointing reminder that the former FBI director put partisanship and personal ambition over patriotism and his legal obligations to the American people."

Perhaps never in the history of our Country has someone been more thoroughly disgraced and excoriated than James Comey in the just released Inspector General’s Report. He should be ashamed of himself! —@realDonaldTrump

In the Senate, Republican Lindsey Graham of South Carolina thanked Horowitz for documenting Comey's "off-the-rails behaviour."

Comey's No. 2 at the FBI in 2017, Andrew McCabe, drew heavy criticism from an inspector general report on a separate matter, and the Justice Department is said to have not yet concluded whether to indict McCabe.

McCabe was fired by the FBI in 2018, just weeks before his retirement date, and has sued the agency, among others.