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

The US 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 on Thursday.

The inspector general's office, which serves as the Justice Department's internal watchdog, said Comey shared a handwritten memo with a friend who described it to the New York Times, in an effort by Comey to pressure the agency 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.

The Justice Department's report is the latest development in an ongoing fight between Comey, who signed off on an investigation into the president's 2016 election campaign and ties with Russia, and Trump, who contends that the investigation should never have begun.

That investigation, headed by former Special Counsel Robert Mueller, unearthed numerous contacts between the campaign and Russian officials but concluded that there was not enough evidence to establish a criminal conspiracy.

Mueller's final report did not reach a conclusion as to whether Trump's efforts to interfere with the probe amounted to criminal obstruction of justice, but it also did not exonerate the president. Attorney General William Barr concluded that he did not see enough evidence to bring obstruction charges.

Democrats in Congress are split as to whether Trump should be impeached for the actions detailed in Mueller's report, while Republicans have largely stood by the president.

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

The Inspector General's report 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.

Comey should not have held on to that memo and others detailing his interactions with Trump after he was fired because they were official FBI documents, the report said.

Comey said on Twitter that people who have accused him of sharing classified information should apologize.

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

FBI spokesman Brian Hale said the report underscored the need for all agency employees, regardless of position, to obey rules about official records. The Justice Department declined to comment, and the White House did not immediately respond to a request for comment.

Some Republicans said the Inspector General's report provides more evidence that the FBI was motivated by political considerations when it started investigating the Trump campaign's contacts with Russia.

"This is the first of what I expect will be several more ugly and damning rebukes of senior DOJ and FBI officials regarding their actions and biases toward the Trump campaign of 2016," Senate Judiciary Committee Chairman Lindsey Graham said in a statement.

The Inspector General's office is currently examining the FBI's conduct during the investigation, and Barr is also overseeing two inquiries into the origins of the Mueller probe: one led by John Durham, the top federal prosecutor in Connecticut, and another involving senior intelligence officials.

Though the Justice Department will not prosecute Comey, he could face other disciplinary action because the Inspector General's report has been referred to the FBI and the department's Office of Professional Responsibility, which investigates employee misconduct.