The end of the most bitter presidential contest in memory is upon us. One candidate says he may or may not respect the results. The other has been the subject of a long national-security investigation by the FBI.

FBI Director James Comey is sworn in before testifying before Congress in Washington U.S. on July 7, 2016. REUTERS/Gary Cameron

Americans have been justly afraid of a crisis before and after the ballots are cast. What if a cyberattack strikes Monday? If self-proclaimed poll-watchers confront voters with violence on Tuesday? If a clear loser refuses to concede and rejects the will of the people on Wednesday?

FBI Director James B. Comey broke ranks with his superiors at the Justice Department on October 28 and fired a loaded weapon in the form of a letter to Congress. On Sunday, that bullet ricocheted. He has inflicted a wholly unnecessary wound on the Democratic presidential nominee and left a scar on the American body politic.

The Justice Department and the FBI have to help protect Americans from all threats, foreign and domestic. To succeed, they must cooperate. But they went to war instead. They afflicted their authority and ability to act in a crisis. It’s a tragedy for this country.

Comey took office in 2013 with a sterling reputation for speaking truth to power. His boss, Attorney General Loretta Lynch, was sworn in at the Justice Department last year, succeeding Eric Holder.

Attorneys general are sworn to uphold liberty and justice for all. The FBI has to protect the national security of the United States. The framers of the Constitution knew that liberty and security are conflicting forces. They also knew America must have both.

Comey’s bureau is, first and foremost, an intelligence service, charged since 9/11 with preventing another catastrophic attack, working closely with the CIA, its longtime rival. The FBI also has to fulfill its traditional 20th-century role of federal law enforcement, operating under the aegis of the Justice Department to uphold U.S. constitutional freedoms.

Comey has to strike that balance while serving both the president and Congress. He now is being damned for appearing to put his thumb on the scale of the presidential election without rhyme or reason. But give him a moment of sympathy before calling him the devil.

He began to get athwart of the White House a year ago. He decried the "Ferguson effect" – the idea, broadly stated, that the Black Lives Matter movement and videos of police brutality impeded American law enforcement. President Barack Obama pushed back. “Stick with the facts,” Obama said in a speech to the International Association of Chiefs of Police, we can’t “use anecdotal evidence to drive policy or to feed political agendas.”

Slideshow ( 3 images )

It’s almost shameful to be compelled to state the following facts: Lynch and Holder are African-Americans. Like Obama, they are lawyers steeped, by training and experience, in struggles over civil rights – and the FBI is, in Comey’s own words, “overwhelmingly white and male.”

FBI agents in the field? About 5 percent are black. The top brass? About 90 percent are white. They are, by their own training and experience, ever-vigilant spies and cops. The political culture of the bureau has always been conservative. It’s fair to surmise that a significant number of the folks at the FBI’s field offices and its Washington headquarters – the J. Edgar Hoover Building – skew to the right.

It’s beyond question that the Justice Department and the FBI went to a war footing on October 28. That day, Comey told Congress that his agents were investigating whether classified information was contained in emails of Huma Abedin, a top aide to Democratic presidential nominee Hillary Clinton, found on the laptop of her estranged husband, disgraced former Representative Anthony Weiner (no relation of mine).

The implication was explosive. The FBI’s pursuit of alleged national-security violations in Clinton’s handling of her own classified emails while at the State Department – an investigation Comey had said was closed in July – might be reopened and unending. Then came a torrent of leaks from present and former FBI agents, some factual, some false. The Justice Department’s top brass, in turn, began bad-mouthing Comey to reporters.

It’s clear that some FBI agents were frustrated by digging dry wells as they investigated Clinton. It’s likely that they wanted Comey to go to Congress. But it’s absolutely certain that his superiors at Justice told him not to. Comey’s disclosure was in clear violation of Justice Department guidelines – and in open defiance of Lynch’s directive – because you just don’t talk about an FBI investigation in progress.

And you never, ever, talk about a probe that could conceivably sway a presidential race right before Election Day. Though no cause and effect can be proved, the race tightened after Comey’s disclosure.

Then, on Sunday evening, November 6, barely 30 hours before polls were set to open in New Hampshire, a bulletin: Comey announced that there was no new evidence concerning Clinton. Nothing to see here, folks. Keep moving.

Obama wasn’t kidding when he said the fate of the republic is at stake this week. The presidential election is probably going to be fraught with potential national-security and federal law-enforcement problems.

Every U.S. intelligence agency agrees that Russia is trying to hack the election system. Republican presidential nominee Donald Trump has appeared to encourage that. Reuters reports that Moscow has forged political documents intended to discredit Clinton and sow chaos in her campaign.

Voting rights are under assault. A federal judge in Ohio has enjoined the Trump campaign from intimidating voters. That order is under appeal at this writing. But worse things are happening than a wrangle in a courthouse. Some voters going to the polls have reason to fear vigilantes may confront them. Someone fire-bombed a black church in Mississippi and spray-painted “Vote Trump” on a charred wall.

Could there be a worse time for the Justice Department and the FBI to have gone to the mattresses as the political crossfire reaches a crescendo? Now neither institution can take action without appearing politically partisan.

The warfare between them poses a threat to American democracy. It’s a clear and present danger for our country.