The FBI threw the 2016 election into chaos for nothing.

On October 28, less than two weeks before the end of the 2016 presidential election, FBI Director James Comey defied Department of Justice guidelines against disclosing politically sensitive details of an investigation by writing a letter to Congress, informing it that the Bureau had potentially discovered new emails from Hillary Clinton’s private server.

That letter upended the race just days before its conclusion. And on Sunday, a little more than a week later, Comey informed Congress that in fact, the emails they had discovered did not alter the original decision not to pursue charges against Clinton for issues related to her use of a private email server while secretary of state.

The FBI guidelines against releasing politically sensitive information close to an election exist for precisely this reason. Comey’s announcement, and subsequent leaks from the Bureau, not only cast suspicion on Clinton days before an election, during a period in which millions of Americans were already voting. They did so for no reason whatsoever, because the new emails did not alter the Bureau’s conclusion about whether or not Clinton had committed a crime. Details of investigations are kept secret precisely to protect the reputations of those being investigated, so that their good names are not enveloped in a cloud of suspicion, and so that the Bureau itself does not become a political tool to be manipulated by partisans to their benefit.

Manipulate they did. House Republicans asserted that the FBI investigation into Clinton had been “reopened,” and began discussing potential impeachment before the results of the election are even known. Erroneous reports on Fox News suggested an indictment of Clinton was imminent. Clinton’s rival, Donald Trump, spent the next week loudly declaring that “this is bigger than Watergate.”

Comey’s motives remain opaque. Some have speculated he was trying to preempt leaks related to the emails from within the Bureau, others that he was concerned about the damage to the Bureau’s reputation should Republicans in Congress discover that he had withheld that information. But the ultimate outcome is that Democratic Party’s political chances of retaking the House have been dashed and its hopes of retaking the Senate are hanging by a thread, even if the damage to the Clinton campaign does not deliver Trump the presidency.

Comey’s decision, notably, did not stop the leaks. Sources within the Bureau told the Wall Street Journal that FBI agents were angry that an attempt to probe the Clinton Foundation, an inquiry spurred by an anti-Clinton book published by a non-profit co-founded by Trump’s campaign manager, Stephen Bannon, had not gone forward. Other law-enforcement sources leaked that Trump’s former campaign manager, Paul Manafort, was under investigation over his ties to foreign governments.  

But Comey’s reasons aside, much of the reporting following Comey’s original letter suggests that some number of agents within the FBI are eagerly trying to swing the election to Trump. An FBI agent told The Guardian that Clinton is “the antichrist personified to a large swath of FBI personnel,” and that “the reason why” Bureau agents had been “leaking is they’re pro-Trump.” Reuters reported that “a faction of investigators” based in the FBI’s New York Office “is known to be hostile to Hillary Clinton.” Trump surrogate and former New York Mayor Rudy Giuliani told Fox News that he had advance notice of Comey’s decision, saying “You’re darn right I heard about it, and I can’t even repeat the language that I heard from the former FBI agents.”

Despite the fact these agents most likely represent a vocal minority rather than the FBI consensus, the risks to democracy should be obvious. The FBI is granted extraordinary authority to investigate and prevent crimes, not to pick winners in elections. The FBI is meant to protect the democratic process, not use its powers to manipulate it. While leaks are an important part of the public’s ability to scrutinize government, elections cannot be free and fair if those in intelligence agencies use the information they gather to damage politicians they don’t like and assist those they do. Doing so is not simply a violation of the Justice Department’s ethical guidelines, it is an abuse of power.

But the damage has been done, and the results are exactly as one might expect: Trump gained support for his assertions that Clinton is an unindicted criminal, the prospects of down-ballot Democrats have suffered since the letter came out, and so the GOP may yet hold both chambers of Congress even if it loses the White House.

The odds of Congress investigating Comey’s behavior or that of the FBI agents who deliberately leaked to the press will be far lower if Republicans retain control of both chambers.

So Comey’s original letter, regardless of his intentions, may not only have saved the GOP’s congressional majority––it may ensure that those within the FBI that attempted to tilt the election towards their preferred candidate face no consequences for their actions. And if no one is held accountable, it is a virtual certainty that this will happen again.