Democrats have yearned for a moment of political exoneration ever since Hillary Clinton’s defeat in 2016. They have looked to Russian interference in the campaign, claims of bias in the media and allegations of Republican lawbreaking to explain an upset that few in the party foresaw.

Perhaps most of all, Democrats have vented indignation at the F.B.I. and its former director, James B. Comey, for reviving the issue of Hillary Clinton’s private email server in the last days of the race.

On Thursday, Clinton supporters won a powerful kind of validation from the unlikeliest source: President Trump’s Department of Justice.

The inspector general’s report criticizing Mr. Comey for his flamboyant handling of the Clinton investigation sent an angry thrill through the ranks of Democrats and Mrs. Clinton’s allies. Michael E. Horowitz, an investigator not appointed by Mr. Trump, concluded that Mr. Comey had twice breached the bureau’s traditional discretion: first by holding a July news conference to announce he would not charge Mrs. Clinton with mishandling classified information, and then later sending a letter to Congress disclosing that the agents were scrutinizing new evidence in the matter.