During the presidency of George W. Bush, Americans heard a lot about the “politicization of intelligence” after Operation Iraqi Freedom went disastrously wrong. Without reopening that whole can of top secret worms, it’s clear our Intelligence Community made some bad calls on Iraq—specifically regarding Saddam Hussein’s alleged weapons of mass destruction.

I know, because I was there. In the early stages of OIF—before it went off the rails—I headed an intelligence task force that spied on the Iraqi military. We didn’t have hard evidence of WMDs, but there wasn’t evidence of their absence either. I, like all my colleagues, assumed Saddam had WMDs because he’d had them in the past, moreover he wanted his enemies to think he still did.

Saddam was a cagey fellow and he had an intricate scheme—what spies call Denial and Deception—to convince Iran (which he considered a much bigger threat to his regime than the Americans) that he had WMDs, when in fact he really didn’t. Alas, that plan worked too well. Saddam successfully fooled Tehran, Washington, and pretty much every intelligence service on earth. We know what happened next.

The consequences of that are still with us today. In Iraq, America got a painful lesson in the politicization of intelligence, particularly what happens when spies tell policymakers what they want to hear. Politicization of intelligence hasn’t gone away, in fact President Obama has done much the same regarding the Islamic State, with the White House making clear the “correct” answers to intelligence questions. As with so many issues, the media considered this a really big problem when George Bush did it, but much less so when Barack Obama does.

In Iraq, America got a painful lesson in the politicization of intelligence: when spies tell policymakers what they want to hear.

However, politicization of intelligence is a manageable problem compared to what’s transpired during Obama’s two terms as our commander-in-chief. I’m talking about the politicization of our secret police—an alarming development that threatens democracy itself.

The Federal Bureau of Investigation, the storied FBI, is the world’s leading law enforcement agency, but it’s also America’s secret police—though most citizens don’t like to think of it that way. As such, the FBI has enormous power. Any democracy which wants to remain one needs to place strict controls on what the secret police can (and can’t) do—and above all, that they remain untainted by raw politics.

The Obama years have witnessed nothing less than the FBI becoming a partisan tool of the Democrats. This has been made painfully clear by the unprecedented hash that Director James Comey’s Bureau made of the investigation of Hillary Clinton’s email problems as secretary of state. I’ve previously used the term “sham” to apply to the FBI’s highly irregular and unethical conduct in EmailGate, and with each new revelation of how the Bureau never really wanted to prosecute anyone in this sordid case, that conclusion gets reinforced.

Neither is this mess confined to cases that involve top Democrats. We see similar forces at work in domestic terrorism, where the FBI follows the lead of the White House and its highly politicized Justice Department, assiduously avoiding any discussions of jihadism unless they are so obvious that they can’t be hidden from the public any longer. In case after case since 2009, the FBI has professed a remarkable inability to detect terrorism—even when it’s obviously Islamist terrorism that we’re talking about—that ought to trouble citizens.

Americans aren’t especially fond of corrupt politicians or Islamist terrorists, so the FBI is siding with the wrong people here. To be clear: the Bureau is made up of Americans of all views and backgrounds, who by and large are the same dedicated civil servants they have always been. The problem, as they say inside the Beltway, isn’t the Indians—it’s the chiefs.

Under Comey, the FBI has become unprecedentedly politicized at the top levels, and this rank partisanship is ruining the Bureau. J. Edgar Hoover—who, whatever his many faults was an almost comically scrupulous public servant who kept his FBI out of partisan politics for five decades—would not like any of this. And he’d be absolutely right.

For the sake of our democracy, we need our secret police force to be non-partisan and willing to investigate corrupt politicians regardless of party affiliation. Whoever the next director is, that person will need to clean partisan hacks out of the FBI with vigor while restoring a sense of mission that does not kowtow to the ruling party in Washington. Here a bit of Hoover’s annoying obsession with minute details would be a godsend.

Part of the reason things have gotten so bad is that the media has been derelict. Out of a desire to not speak ill of Barack Obama and Hillary Clinton, while covering for Democrats generally, the mainstream media has shied away from serious investigation to what’s happened to the FBI since 2009. As a result, the public is learning only near the end of Obama’s second term what a politicized mess the Bureau has actually become. None of this bodes well for our democracy or the rule of law.

Politically-motivated double standards in what is considered reportable are hardly a new problem in America, but like so many things this went into overdrive with Barack Obama’s election as president. When the Fourth Estate nakedly assumes a partisan viewpoint, while pretending not to, democratic values get corroded.

This corrosion is now ubiquitous. Take the news this week that New York has banned the Trump Foundation from raising money in that state over alleged improprieties involving financial reporting requirements. Eric Schneiderman, the New York attorney general, has been all over the media, practically gloating about his direct attack on the Republican presidential nominee.

Irregularities with the Trump Foundation have been known for some time. Why is Schneiderman choosing now, four weeks before we vote, to go public with it?

I’m no fan of Donald Trump, and let’s just assume he’s done exactly what AG Schneiderman has accused him of. The media has covered this story a great deal, no doubt because it’s deeply unflattering to Trump and the Republican party. Yet, as usual, the mainstream media has omitted half the real story here.

It’s unusual for any state attorney general to go to war with any party’s presidential nominee only a month before an election. In fact, such things were once considered out-of-bounds, since they smack of naked partisanship by law enforcement. Irregularities with the Trump Foundation have been known for some time. Why is Schneiderman choosing now, four weeks before we vote for president, to go public with it? The media should be asking this.

I won’t be voting for Trump (or Hillary either, for reasons my regular readers know all about), in fact I’ve been very tough on him here and here. But I am a supporter of a non-political justice system because we’ve seen what happens all over the world when law enforcement is viewed as an arm of the party in control of the executive branch.

That’s the direct route to undermining democracy and the rule of law. Eventually, you wind up like the Philippines, where President Rodrigo Duterte has gleefully said he’s “at war” with drug dealers, encouraging vigilante attacks which have killed more than 3,600 people in the last three months. This extrajudicial campaign includes secret police death squads to eliminate opponents of Duterte and his rough justice.

This is an extreme case, of course, but it illustrates what can happen when your secret police gets politicized, above the law, as an appendage of the ruling party. That is the death of democracy—and lots of people too. America needs to be more vigilant about keeping the FBI and our entire law enforcement apparatus far above partisan politics. The media doing its job, reporting the truth even when painful, would be a big help to that end.

John Schindler is a security expert and former National Security Agency analyst and counterintelligence officer. A specialist in espionage and terrorism, he’s also been a Navy officer and a War College professor. He’s published four books and is on Twitter at @20committee.