As it came under siege from President Donald Trump and congressional Republicans over the past month, the Federal Bureau of Investigation found an unlikely group in its corner. “Democrats have found themselves racing to defend the FBI over the last month,” McClatchy’s Alex Roarty wrote on Monday, adding that this “recently would have been considered anathema to everything the left—as self-described defenders of civil rights—represents.”

This worries some on the left. “The politics is a problem here,” Faiz Shakir, national political director for the American Civil Liberties Union, told Roarty. “Because at the moment, you have an administration who is attacking law enforcement, and across the board it raises the possibility of out-flanking to him the right.” He added, “Too many Democrats are ready to seize that, because it’s a political opportunity.”

The Intercept’s Glenn Greenwald, a longtime critic of U.S. intelligence policies, sees hypocrisy in this about-face from Democrats:

These skeptics are right to be wary of federal law-enforcement agencies and those who lead them, given the abuses of the past. But those abuses also underscore the danger of letting Republicans turn the bureau into a political tool for their own purposes—and that’s why Democrats are right to defend the FBI today.

The agency has a dark history. In the 1950s and 1960s, it conducted a campaign of surveillance and harassment against groups that it viewed as threats to the American social order, including civil-rights activists, opponents of the Vietnam War, and other supposed “subversives.” The bureau sent Martin Luther King, Jr. a letter threatening to reveal his “immoral conduct” unless he killed himself. More recently, the FBI has come under criticism for sting operations that coax defendants into carrying out fake terrorist operations, and for labeling “black identity extremists” as potential threats.

Ironically, the FBI’s most egregious breaches of public trust in the modern era occurred under Director James Comey, whom Trump fired last year and has become a critic of president’s war on the agency. The Justice Department, which administers the FBI, has policies that forbid officials from taking actions in criminal investigations of public figures that could influence an imminent election. Nonetheless, Comey made two major interventions in the 2016 presidential race. He publicly castigated Hillary Clinton’s use of a private email server, despite bringing no criminal charges against her, then sent a letter to Congress two weeks before Election Day announcing the bureau had reopened its investigation. He followed up two days before Election Day to note that nothing relevant had been discovered, but the damage was already done: His actions may have cost Clinton the election.

Comey’s actions inflicted the very damage to the FBI that they were supposed to prevent. “Comey sought to appease the Republicans whose complaints and criticisms he took seriously enough to address by breaking Justice Department guidelines,” The Atlantic’s Adam Serwer noted after the director’s ouster in May. “But he never seems to have taken Democratic complaints that seriously, or ever feared that their frustration with the FBI would compromise the bureau’s political independence.”

Now, the Republicans are the frustrated ones—and because they control the entire government, they have the power to compromise the FBI’s independence. Trump knows the agency’s credibility isn’t bulletproof. After all, he used Comey’s election antics as a pretext for firing him last May. But the allegations of anti-Republican partisanship within the FBI, as detailed in a declassified memo released last week by House Intelligence Committee Chairman Devin Nunes, don’t hold up to scrutiny. Instead, the memo’s release appears to be the latest salvo in a growing Republican campaign to protect the president from further political damage by discrediting and delegitimizing the Justice Department and the FBI. Such a move would give Trump enough of a pretext to oust Deputy Attorney General Rod Rosenstein or special counsel Robert Mueller and bring the Russia investigation to a halt.

Ousting Mueller and Rosenstein would be a constitutional crisis and a blow to the American rule of law. But the long-term impact of his attacks extends beyond the Russia case. Trump and his allies have taken a wrecking ball to post-Watergate reforms that were designed to constrain federal law enforcement. Among the pillars of those reforms are the House and Senate intelligence committees, which Congress created to keep U.S. intelligence agencies in check. Instead of fulfilling that duty, Nunes engaged in partisan stunts that have shredded House Intelligence Committee’s credibility for the foreseeable future.

That leaves Richard Burr, the North Carolina Republican who leads the Senate Intelligence Committee, as the only credible watchdog in Congress to oversee America’s vast intelligence apparatus. He’s handled the Russia probe in a straightforward and bipartisan manner alongside Mark Warner, his Democratic counterpart. But even Burr’s powers have their limits: A short-term funding bill passed by Congress last month included a White House–backed provision that strips the intelligence committees of some of their oversight powers, despite Burr and Warner’s objections.

The other major check on abuses by the agency is the FBI’s internal culture. Presidents from Franklin Roosevelt to Richard Nixon used the bureau as a political tool to spy on their political opponents and groups they viewed as hostile. But after Hoover’s death, the Watergate crisis, and the mid-1970s reforms that followed, the FBI effectively declared its independence from the White House. FBI directors serve ten-year terms not only to avoid another entrenched reign like Hoover’s, but also to keep them detached from the regular political turnover of presidential administrations. Trump threatens that balance by firing directors at will and publicly bullying its upper ranks into submission.

What would a more politicized FBI look like? Immigration and Customs Enforcement, the Department of Homeland Security agency charged with removing unauthorized immigrants, provides a cautionary tale.

Obama built up ICE’s enforcement powers in the hopes of persuading Republicans to reach a grand bargain with him on immigration, despite activist criticism of its abuses. No bargain was struck. Now, the agency has embraced its role as Trump’s draconian “deportation force.” Its agents have deported activists who oppose it, targeted long-time immigrants for minor criminal offenses, and carried out mass workplace raids in states that refuse to cooperate. Thomas Homan, ICE’s acting director, recently threatened to arrest elected state and local officials who back sanctuary-city laws.

With the FBI, the potential risks are even higher. Trump all but openly campaigned on abusing his powers to investigate and jail his political opponents. Bringing the bureau to heel would make that possible.