For those who first learned the name of James Comey in 2016, the progress of this past year may have seemed like a cruel farce.

Unable to come up with a sufficient basis for an indictment of presidential candidate Hillary Clinton, the former FBI director nonetheless closed the bureau's investigation of her private email server by giving her a stern and public chastisement — a move that angered Democrats who saw that departure from normal practice as blatantly political while enraging Republicans convinced of Clinton's guilt. Then, when new evidenced surfaced on the eve of the election, he announced the reopening of the investigation, quite possibly tipping the balance to elect President Trump. And finally, since being retained by Trump, he has publicly fretted about having unintentionally changed history, then testified to Congress in ways that were quickly revealed to be misleading — which provided the official rationale for his Tuesday dismissal by the president.

If Comey was trying to put his thumb on the scales for the Republicans, he could not have done so in a more ham-handed fashion. If he was trying to stay above the partisan fray, he could not have failed more spectacularly. He will likely be remembered more as a fool than a villain, the fellow who stumbling after an intruder with his candle in the dark, lit the drapes on fire and ultimately burned the house down.

But I see Comey as a tragic figure, in the classic sense: someone undone by a flaw that is inseparable from his virtues. His fall is a sign of just how corrupted by rabid partisanship our government has become. And if we don't do something about that, James Comey won't be the last honorable public servant who turns himself into exactly what he was trying to keep himself from becoming.

To remind ourselves who Comey was before the Clinton email scandal erupted, we should recall his exemplary performance as U.S. attorney. After that, during the Bush administration, he was one of very few senior legal officials who resisted the effort to expand the scope of the NSA's activities and one of the few who pushed back in any meaningful way against the legitimation of torture techniques in interrogations. His Senate testimony in the U.S. attorney dismissal scandal, in which he contradicted the testimony of his boss, Attorney General Alberto Gonzales, should have been his epitaph:

The Department of Justice, in my view, is run by political appointees of the president. The U.S. attorneys are political appointees of the president. But once they take those jobs and run this institution, it's very important in my view for that institution to be another in American life, that — because my people had to stand up before juries of all stripes, talk to sheriffs of all stripes, judges of all stripes. They had to be seen as the good guys, and not as either this administration or that administration. [Comey]

Comey, a lifelong Republican, was appointed by President Obama to head the FBI precisely because he wanted a "good guy" in the job, and someone who would be seen as such across party lines. But in the best of circumstances, it would be impossible to be seen as a "good guy" while investigating a major party candidate. And these are not the best of times.

From the beginning of the investigation into Clinton's emails, Comey's clear priority was to preserve the integrity of the FBI and his own reputation. But the Republican Party leadership and the conservative media machine made it abundantly clear that anything short of an indictment would be portrayed as a cover-up, and would likely lead to Comey himself being investigated. Comey could have gone to war with his own party on behalf of the bureau — but his own soldiers would not have followed him into battle. Indeed, one reason Comey informed Congress about the new emails discovered in October may well be that he feared rogue agents would have leaked them if he hadn't. Instead, Comey tried to keep his potential critics at bay — and wound up politicizing the FBI far more severely than he would have had he simply kept his head down, done his job, and been tarred and feathered by Congress.

It's not just the Republicans, though. By nominating Clinton in the first place, the Democrats put Comey in an impossible position. Had he gone to war with his party over the email investigation, Comey would have effectively been certifying Clinton's innocence. It is entirely reasonable to assume that regardless of whether he had the basis for an indictment, Comey had doubts on that score — and beyond that, he was surely concerned that doing so would also amount to an intervention in the election. A party concerned first and foremost with its own integrity would never have put itself in the position of mortgaging itself to Clinton's defense in the first place, regardless of whether they were inclined to believe the charges were spurious or not. They would have passed her over, and said: I'm sorry, but that's politics.

Could Comey have resigned last summer, rather than attempt to thread the needle that skewered him? That would have solved his personal dilemma — but it would have amounted to a declaration that the job was impossible, that, effectively, the FBI could not do its job. I can understand why he would have been loathe to say any such thing. Instead, he proved by his actions that nobody could.

Perhaps he intended to redeem himself by showing he could be just as diligent in investigating the man he inadvertently helped elect as he was in his investigation of his opponent. Instead, he's been summarily fired, and Democrats who were calling for his head just days ago are now horrified to see it handed to them in circumstances that strongly suggest an attempt to stymie his investigation. His replacement has been so thoroughly politicized before even being nominated that I truly wonder who would want to take the job.

And so I call Comey a tragic figure. His very desire to preserve his integrity is precisely what destroyed it, and now threatens the Bureau itself. I hope, in the wake of his dismissal, that he takes stock of the wreck he has made of his reputation and his career, and tells his story in a manner purged of self-serving justification. It is the last, best service he can do his country.