What a year it has been for James Comey!

At the start of 2016, the FBI director enjoyed a reputation as a public servant of high integrity, earning bipartisan acclaim for his stewardship of the nation’s preeminent law enforcement agency.

A year later, the FBI, after a series of blows to its credibility, seems increasingly partisan. Comey has shown himself to be an inconsistent leader. And an ugly conclusion is becoming difficult to escape: He single-handedly caused Donald Trump to win the presidency.

Doubt on that last point should have been dispelled this week, after court documents were released Tuesday that showed the justification for Comey’s decision — announced to the nation just 11 days before the election — that he was reopening his investigation into Hillary Clinton’s emails. We now know Comey’s bombshell was based on nothing: The FBI had no evidence of wrongdoing in the newly discovered emails, found on Huma Abedin and Anthony Weiner’s laptop, and no reason to suspect there was anything on the laptop that the FBI hadn’t already dismissed as insufficient to mount a prosecution.

Yet that was the flimsy basis for Comey’s letter to Congress reopening the Clinton probe. The new emails were irrelevant or redundant. But by the time Comey said, just two days before the election, that the FBI found nothing new, the damage to Clinton was done.

(Reuters)

When an election is this close — Clinton, in the final tally, won the popular vote by 2.8 million votes — any number of factors could have shifted the outcome: Russia’s hacking, Jill Stein’s Green Party candidacy, Clinton’s weaknesses as a candidate, her ill-advised message of continuity in times that demanded populist change.

But Comey’s intervention is one thing that almost certainly changed the result. Nationwide, voters who decided in the last week — the time when Comey’s announcement dominated the news — overwhelmingly went for Trump. Late-deciders went for Trump by 17 points in Florida and Pennsylvania, by 11 points in Michigan and 29 points in Wisconsin.

I doubt Comey meant to give the presidency to Trump. All along, I maintained that he was a man of integrity. But he demonstrated poor judgment. So protective was he of his above-the-fray reputation that his attempts to guard it caused a series of bad decisions. Ironically, his attempts at preserving his reputation were what hurt him.

In June, before Comey’s July statement on the Clinton email issue, 48 percent of Americans expressed confidence in the FBI and 16 percent lacked confidence, according to an NBC-Wall Street Journal poll. Now, six months later, 37 percent have confidence in the FBI, while 27 percent don’t — and Republicans and Democrats are almost identical in their views.

Comey’s trouble began with his announcement, on the eve of the national political conventions, that no reasonable prosecutor would bring charges against Clinton over the emails. His no-prosecution recommendation infuriated congressional Republicans. This criticism must have stung, since Comey, a former George W. Bush administration official, then took a series of actions that seemed designed to repair his reputation with Republicans.

First, he refused to join an administration statement on Oct. 7 naming Russia as the perpetrator of hacks of American political organizations. He reasoned that the FBI shouldn’t be seen as injecting itself into politics so close to an election.

Comey made a mockery of such considerations when he delivered his October Surprise later that month, defying warnings from the Justice Department and ignoring long-standing guidelines by announcing that he was reopening the Clinton probe.

(Peter Stevenson,Victoria Walker/The Washington Post)

It probably wasn’t done to torpedo Clinton, though that was the result. The most convincing explanation: Comey feared that already irate congressional Republicans, if they were to learn that he didn’t disclose the new discovery of Clinton emails, would have trashed his integrity. And Republicans were certain to find out. The Trump campaign’s Rudy Giuliani, the recipient of leaks apparently originating with anti-Clinton agents in the FBI’s New York office, had already signaled that big news was about to break.

Since the election, Comey has continued to protect his reputation — at considerable cost. Earlier this month, news broke that the CIA had concluded Russia intervened in the election to help Trump. But FBI officials resisted joining the conclusion.

Perhaps Comey was again trying to keep his agency and himself above the fray, but the FBI’s mush helped Trump dismiss the CIA’s findings. The matter turned into a partisan fight rather than the national-security concern it should be. After several days, and the intervention of the director of national intelligence, Comey finally acknowledged the obvious: that the FBI, too, believes the Russians tried to help Trump.

Did Comey mean to become Trump’s elector and, now, his protector? Probably not. But in the end, motives count for less than outcomes. And Comey’s have been ruinous.

Twitter: @Milbank

Read more from Dana Milbank’s archive, follow him on Twitter or subscribe to his updates on Facebook.