The political class is seriously underestimating the impact of Hillary Clinton’s email controversy. They see it mainly as a problem of public opinion and electoral politics, where it has been increasingly costly but not yet fatal. The political damage—the drip, drip, drip of revelations—has been bad, but there is worse to come.

Hillary Clinton’s big problem now is legal, and it could well be insurmountable politically. Here’s why. Once a “political” issue finally moves into the legal system, as the Clinton email server has, it moves forward with an independent logic. That logic will slowly ensnare Secretary Clinton.

You can already see it happening. Two weeks ago, the Department of Justice acknowledged that it “has received a referral related to the potential compromise of classified information.” The referral was not criminal, and the Clinton camp immediately pummeled the New York Times’ sloppy reporting that it was. But that’s small ball and misleading at that. The DOJ is not investigating a civil matter here. It is investigating a crime. As that investigation moves forward, it will take on a life of its own, as it should in a government of laws.

Even if the Department of Justice is highly politicized—and it is—there is a powerful legal procedure here that will be hard to kill off. It began when the intelligence community’s inspector general, I. Charles McCullough III, and his counterpart at the State Department, Steve Linick, made a referral to DOJ, saying that classified materials may have been compromised. McCullough also wrote Congress that a spot check of 40 Clinton emails showed that "four contained classified [intelligence community] information." That meant classified materials were being held in an unauthorized, insecure site—the Clinton server. In fact, the materials were also being held in a second unauthorized site. Clinton had given the materials to her attorney, David Kendall, on thumb-drives for his safekeeping. Since the communications are, by her own admission, official business and possibly classified, she may not have been authorized to transfer them, nor he to receive them.

The FBI has clear legal responsibilities when it is presented with such a referral. It must investigate and secure the materials. Fortunately, the FBI is run by a director with a reputation for independence and integrity. James Comey’s agency has now gotten the server and thumb-drives, the ones Clinton said she would never give up. She had no choice but to surrender them or face obstruction-of-justice charges.

The legal and bureaucratic wheels will keep turning, and they will grind exceedingly fine. Since classified information was on the server, the Central Intelligence Agency, National Security Agency, and other intelligence services will be tasked with going through thousands of documents. They will want to know where the information originated, whether it was classified (either when it was received or later), and whether senior officials like Secretary Clinton and her top aides should have known the material was sensitive or subject to classification, even if it was not marked that way at the time. The intelligence agencies are already livid about this breach of security, and they will go through this material carefully. My guess is they will find hundreds of documents that should never have left a secure government location.

They will want to know several more things. Did the Clinton server meet the federal government’s standards for how servers are built, how they are secured, and how data is retained? Was all sensitive material encrypted or did it circulate without those protections? Did anybody hack into the server? Did Secretary Clinton, who says she erased all “personal” emails from the server, actually erase some government documents? If so, was that inadvertent or a possible coverup? Who handled IT security for this server? Could he read the materials if he wished? These are legal questions with huge political ramifications.

I assume the Department of Justice will be lethargic. Under Eric Holder, the Obama Justice Department was the most politicized since John Mitchell cleaned the Augean Stables for Richard Nixon. The department is still packed with political appointees, but Holder’s successor, Loretta Lynch, has a good reputation from her days as a prosecutor. She may well play this straight. If so, then she would start with the IT guy and Clinton’s assistants and try to roll them up, as you would in a normal criminal probe. My guess is she will do that only if she gets a wink and a nod from a White House ready to sink Hillary.

Politicized or not, the DOJ will be increasingly boxed in by the FBI and intelligence community investigations. Normally, when the intelligence community finds classified materials in unauthorized locations, it seeks felony prosecutions. Gen. David Petraeus was sunk for keeping his own personal calendars in an unlocked drawer at home. The calendars were deemed classified, even if they lacked an official stamp. President Clinton’s CIA Director, John Deutsch, lost his job and security clearance for using his portable computer at home. It had classified material on it. Those violations are trifling compared to Hillary Clinton’s exposure.

If the FBI officially determines classified material was being held on the server, or foreign intelligence agencies hacked into it, or official materials were erased and not turned over to the courts, as Clinton stated under oath she had, then Director Comey will face the hardest decision of his professional life. If he recommends prosecution and the DOJ refuses, you can be sure an infuriated intelligence community will leak the news. That would be fatal to Clinton politically since it would smell like a cover-up. It is possible, of course, that the investigations will give Secretary Clinton a clean bill of health. But it is far more likely that they will bring legal peril, and, with it, political disaster.