Those choices were responses to Republican complaints that the Clinton email investigation had been compromised by a brief meeting between then-Attorney General Loretta Lynch’s and former President Bill Clinton, the husband of the Democratic presidential nominee, and then later to attacks from Donald Trump, who as a candidate loudly proclaimed that the investigation had been “rigged.” Without that political climate, there would have been no threat to the FBI’s independence, and no need for Comey to fear that it could be compromised. In other words, despite insisting he was not considering anyone’s political fortunes, he was in fact, considering his own and that of the FBI.

Comey testified to Congress that his July announcement was made necessary by a meeting between Clinton and Lynch. He felt the need to reassure the public that there had been no political influence on the investigation. His October announcement, he told Congress, was necessary because he had testified that the Clinton email investigation was closed and wanted to ensure he was not misleading Congress.

Both his June and October announcements were cited as reasons for Comey’s dismissal in a memo authored by Deputy Assistant Attorney General Rod Rosenstein. Rosenstein wrote that Comey was “wrong to usurp the Attorney General’s authority” with his July announcement. While Comey had framed his October choice as one between speaking or concealing that the investigation had been re-opened, Rosenstein wrote that when “federal agents and prosecutors quietly open a criminal investigation, we are not concealing anything; we are simply following the longstanding policy that we refrain from publicizing non-public information.”

Indeed—by following procedure and not similarly disclosing that the FBI was also investigating the Trump campaign’s potential connection to Russian interference in the election, Comey had effectively shielded the Republican candidate from political peril while likely fatally damaging Democratic chances of winning the White House.

Many of those who know Comey—including Democrats dismayed by his actions—believe him to have done what he believed was best. Even his most ardent critics do not believe whomever Trump chooses as his replacement is likely to be better.

It is nevertheless hard to dispute that Comey’s decisions offered legitimate grounds for dismissal. Yet given that both Trump and Attorney General Jeff Sessions praised Comey’s conduct at the time, and the existence of an ongoing inspector general investigation into Comey’s decisions, the stated rationale for Comey’s firing seems a farce that no one, not even its proponents, actually believes.

The strongest defense of Comey’s behavior is that the bureau faced a much greater threat of interference from Republicans than Democrats. The right-wing media environment incubates conspiracy and extremism with few moral or commercial restraints. Republicans controlled both houses of Congress, and their presidential nominee was publicly undermining faith in the bureau at campaign rallies. After watching the GOP convene more than a dozen inquiries into the 2012 attack on the U.S. embassy in Benghazi, Libya, there was no small risk that the bureau could face a similar fate to that of the State Department if Republicans saw Comey as protecting Clinton by not telling Congress the FBI was reopening the email inquiry. Comey was also reportedly concerned about potential leaks to the press about the investigation from Trump supporters at the bureau.