The day before he upended the 2016 election, James B. Comey, the director of the Federal Bureau of Investigation, summoned agents and lawyers to his conference room. They had been debating all day, and it was time for a decision. Mr. Comey’s plan was to tell Congress that the F.B.I. had received new evidence and was reopening its investigation into Hillary Clinton, the presidential front-runner. The move would violate the policies of an agency that does not reveal its investigations or do anything that may influence an election. But Mr. Comey had declared the case closed, and he believed he was obligated to tell Congress that had changed. “Should you consider what you’re about to do may help elect Donald Trump president?” an adviser asked him, Mr. Comey recalled recently at a closed meeting with F.B.I. agents. He could not let politics affect his decision, he replied. “If we ever start considering who might be affected, and in what way, by what we do, we’re done,” he told the agents.
But with polls showing Mrs. Clinton holding a comfortable lead, Mr. Comey ended up plunging the F.B.I. into the molten center of a bitter election. Fearing the backlash that would come if it were revealed after the election that the F.B.I. had been investigating the next president and had kept it a secret, Mr. Comey sent a letter informing Congress that the case was reopened.
What he did not say was that the F.B.I. was also investigating the campaign of Donald J. Trump. Just weeks before, Mr. Comey had declined to answer a question from Congress about whether there was such an investigation. Only in March, long after the election, did Mr. Comey confirm that there was one.
For Mr. Comey, keeping the F.B.I. out of politics is such a preoccupation that he once said he would never play basketball with President Barack Obama because of the appearance of being chummy with the man who appointed him. But in the final months of the presidential campaign, the leader of the nation’s pre-eminent law enforcement agency shaped the contours, if not the outcome, of the presidential race by his handling of the Clinton and Trump-related investigations.