WASHINGTON — The F.B.I. and Justice Department faced a hard decision in two investigations this past summer that had the potential to rock the presidential election. The first case involved Donald J. Trump’s campaign chairman, Paul Manafort, and secretive business dealings in Ukraine. The second focused on Hillary Clinton’s relationships with donors to her family foundation.

At the urging of the Justice Department, the F.B.I. agreed not to issue subpoenas or take other steps that would make the cases public so close to the election, according to federal law enforcement officials.

Against this backdrop, the decision of the F.B.I. director, James B. Comey, to send a letter to Congress last week about a renewed inquiry concerning Mrs. Clinton’s emails is not just a departure from longstanding policy; it has plunged the F.B.I. and the Justice Department directly into the election, precisely what Justice officials were trying to avoid.

Mr. Comey’s letter, which he sent over the objections of the Justice Department, stirred outrage across party lines. It unleashed a torrent of news that laid bare the government’s internal deliberations and exposed the infighting and occasional mistrust between rank-and-file F.B.I. agents and senior department officials.