James Comey was “insubordinate” and “dramatically” broke from FBI norms in his handling of the investigation into Hillary Clinton’s use of a private email server in 2016, but was not politically motivated in his actions, according to a scathing 568-page inspector general report released Thursday.

The former FBI director made numerous errors, including a failure to adequately coordinate with Department of Justice leadership, that harmed the reputation of federal law enforcement institutions, DOJ watchdog Michael Horowitz found.

According to Horowitz, Comey engaged in “subjective, ad hoc decision-making” during the investigation that deviated from bureau norms. Further, the watchdog wrote, text messages between FBI officials Peter Strzok and Lisa Page — which have been at the center of allegations that the bureau was biased against President Donald Trump — “raised questions about the objectivity” of the FBI, though internal investigators did not find evidence that the agents’ actions “directly affected the specific investigative actions.”

Anticipation over the report’s conclusions has become a hot-button political issue, particularly for Trump, who has criticized Comey as being partisan.

“We found that Comey largely based his decisions on what he believed was in the FBI’s institutional interests and would enable him to continue to effectively lead the FBI as its director,” Horowitz, the Justice Department’s inspector general, wrote.

“While we did not find that these decisions were the result of political bias on Comey’s part, we nevertheless concluded that by departing so clearly and dramatically from FBI and department norms, the decisions negatively impacted the perception of the FBI and the department as fair administrators of justice,” he wrote.

Trump and his allies will likely seize on the Inspector General’s conclusions as part of their ongoing efforts to undermine the FBI, which is continuing to investigate possible collusion between the Trump campaign and Russia, along with potential obstruction of justice on the part of the president.

Trump routinely bashes the Russia probe as a “witch hunt” and has painted Comey, whom he fired in 2017, as an emblem of the FBI’s “corruption.” The president has also played up expectations for the report, questioning earlier in June why it was “taking so long” to be released and speculating that it could have been “changed and made weaker.”

“There are so many horrible things to tell, the public has the right to know,” Trump tweeted on June 5. “Transparency!”

Comey announced in July 2016 that Clinton, then the Democratic nominee for president, had been “extremely careless” in her handling of classified information as secretary of state, but that “no reasonable prosecutor” would bring charges against her.

“We cannot find a case that would support bringing criminal charges on these facts,” Comey said in a dramatic statement to the media during a press conference.

Then, in October, just days before the election, Comey announced that the FBI was reopening the Clinton probe after uncovering a new batch of emails during an investigation into former congressman Anthony Weiner — the husband of top Clinton aide Huma Abedin. While the FBI would once again clear Clinton, many — including Clinton herself — believe Comey’s actions contributed to her stunning loss in 2016.

Trump cited Comey’s handling of the Clinton probe when he fired him in May 2017, but has repeatedly suggested that the Russia probe was a factor in his decision.

The circumstances surrounding Comey’s termination are believed to be a significant point of interest for special counsel Robert Mueller, who was appointed to lead the Russia probe after the FBI director’s departure.

Comey has since emerged as a vocal critic of Trump, who has in turn bashed him as an “untruthful slime ball.” The president — who was briefed on the Inspector General report before its public release — has also characterized Comey’s investigation into Clinton as “dishonest” and suggested the FBI’s investigation into his campaign is a “hoax” put forth by Democrats working in concert with federal law enforcement officials.

According to former federal prosecutor Patrick Cotter, while Comey’s mishandling of the Clinton probe “does not help” the reputations of the FBI and Department of Justice, Trump’s “relentless and unprecedented attacks” on federal law enforcement could do more longterm damage to the agencies “than anything that has happened in the history of the nation’s law enforcement institutions.”

“It is one thing to have agencies make mistakes, even terrible mistakes,” Cotter said on Thursday. “It is another to have the president of the United States repeatedly and forcefully accuse entire agencies of being corrupt at their root and in the hearts of the people who spend their lives working in those agencies and department.”

In a New York Times op-ed Thursday, Comey wrote that while he did not agree with the inspector general’s conclusions, he welcomed the report in the interest of “truth and transparency.”

“I was not certain I was right about those things at the time,” Comey wrote. “That’s the nature of hard decisions; they don’t allow for certainty. With the added benefit of hindsight, the inspector general sees some things differently. My team believed the damage of concealing the reopening of our investigation would have been catastrophic to the institution. The inspector general weighs it differently, and that’s OK, even though I respectfully disagree.”

Thursday’s inspector general report could become the newest line of attack for Trump and his allies.

A previous inspector general report earlier this year sharply criticized Comey’s former deputy, Andrew McCabe, for misleading internal investigators about media disclosures he made related to the FBI’s probe into the Clinton Foundation.

Attorney General Jeff Sessions fired McCabe in anticipation of the report’s April release, days before he was set to retire. Trump — who has been highly critical of Sessions over his decision in 2017 to recuse himself from the Russia probe — cheered the termination as a “great day for Democracy.”

Sessions told the Hill on Wednesday evening that the new Inspector General report could result in more firings.

“If anyone else shows up in this report to have done something that requires termination we will do so,” Sessions said.

Both Democrats and Republicans touted the Inspector General’s findings Thursday in support of their own views.

Rep. Trey Gowdy (R-S.C.), a majority member of the House Intelligence Committee, said in a statement that the report “destroys confidence in the impartiality of the institutions I have long served, respected, and believed in” and called on Sessions to “restore Americans’ confidence in our justice system.”

“This is not the FBI I know,” Gowdy said. “This is not the FBI our country needs. This is not the FBI citizens and suspects alike deserve.”

But Democrats on Thursday said the report proved Comey’s actions “helped Donald Trump become president” and accused Republicans of exerting undue pressure on law enforcement officials on the Clinton investigation.

“The great irony today is that Republicans in Congress are now engaged in the same kinds of attacks ... only this time they are aimed at Special Counsel Mueller,” Reps. Jerry Nadler (D-N.Y.) and Elijah Cummings (D-Md.) said in a joint statement. “We have no doubt that the Special Counsel has the judgment and integrity to continue to follow the facts where they lead, without consideration for politics, and reserving comment until his prosecutors appear in court.”

June 14, 2018, 4:22 p.m. Eastern: This story has been updated.