In a fusillade of Twitter posts this week, President Donald Trump blasted his attorney general, Jeff Sessions, for failing to pursue probes of Hillary Clinton and former FBI Director James Comey. It is unclear whether the president’s posts will spur his attorney general and the Justice Department to pursue investigations into either individual. It is increasingly clear, though, that Trump has no compunction about using the machinery of federal law enforcement as a weapon against his political opponents. What he probably doesn’t realize is that he is committing a crime by doing so.

There are 120,000 full-time federal law enforcement officers in the United States, all of whom report—at least indirectly—to the president. Meanwhile, the federal criminal code runs to 868 pages, with many crimes defined vaguely and many rarely enforced. If the president wants to use the vast investigative and prosecutorial infrastructure at his disposal to go after his rivals, it’s likely that federal law enforcement officers will be able to find some provision that his opponents have violated. Even if not, the president could make his opponents’ lives miserable with ceaseless probes and baseless charges.

But the very breadth of federal law enforcement power has, at least since Richard Nixon abused it, given rise to a strong norm of independence from political control. While the president is the nominal head of the executive branch and can order the Justice Department to follow his priorities, he must not use his authority to criminalize political opposition or harass his opponents.

A now mostly forgotten political scandal from George W. Bush’s second term shows what can happen when an administration tries to transform the Justice Department into a political weapon. To put that scandal in context: Each of the federal judicial districts has a U.S. attorney who serves as its chief federal prosecutor. The president can fire any one of them at any time. In 2006, Bush dismissed nine, including—most controversially—the U.S. attorney in New Mexico, David Iglesias.

Iglesias says he was fired after a number of Republican officials in the state pressured him to bring corruption charges against a prominent Democratic politician in the run-up to the 2006 midterm election. That would potentially violate obstruction of justice laws, which make it a crime for anyone to “corruptly” influence a grand jury investigation or agency proceeding (among other matters). A subsequent Justice Department report recommended the appointment of a special prosecutor to investigate whether Bush administration officials had broken the obstruction laws in the course of the Iglesias firing. The report stated: “[W]e believe that pressuring a prosecutor to indict a case more quickly to affect the outcome of an upcoming election could be a corrupt attempt to influence the prosecution in violation of the obstruction of justice statute.” The report added that the obstruction laws didn’t just apply to the indictment of an opponent prior to an election—they “could apply to pressuring a prosecutor to take partisan considerations into account” under other circumstances as well.

A special prosecutor was ultimately appointed to investigate the Iglesias firing and eventually concluded that there was insufficient evidence that any Bush administration official had pressured the New Mexico U.S. attorney. But all along, the Justice Department proceeded on the assumption that administration officials could be charged with obstruction if they had sought to influence Iglesias’ investigation for partisan purposes. In that case, there was no smoking gun: no tweets in which the president intimated that he would fire the prosecutor unless the prosecutor brought charges against the president’s political rival. (Twitter was only a few months old then, and Bush was not a user.)

Today, by contrast, the gun smokes in 140-character plumes. In one of his posts, Trump asked why his “beleaguered” attorney general wasn’t “looking into” Clinton’s “crimes and Russia relations.” In others, he complained of Comey’s “illegal leaks” of memos to the New York Times and berates Sessions for taking a “VERY WEAK position” on leaks and on Clinton’s alleged mishandling of classified material. In yet another, he blasted Sessions for failing to replace the acting FBI director with someone who will go after Clinton with vigor. On Wednesday, the Washington Post published a piece sourced to “four people familiar with the issue” indicating that Trump may fire Sessions—a leak that may be aimed at Sessions himself.

Is Trump “pressuring” his attorney general and the acting FBI chief to pursue cases on the basis of “partisan considerations”—the sort of conduct the Justice Department said could amount to criminal obstruction? Seems like it. If Trump follows up by replacing Sessions, the parallels to the Iglesias firing will be even stronger, except that this time there will be ample evidence of the president’s motive.

To be sure, Trump—as president—has a constitutional responsibility to take care that the laws are faithfully executed, and he might argue that this is what motivates his interest in the Clinton and Comey cases. But if a jury could be convinced that Trump’s motives are political rather than in the public interest, then his advocacy for action against Clinton and Comey could be considered “corrupt,” thus amounting to criminal obstruction. That, at least, appears to be the implication of the Justice Department report regarding the Iglesias episode, and it is consistent with the way the obstruction laws have been interpreted in other contexts.

Trump’s power over the Justice Department might dissuade prosecutors from pursuing obstruction charges against him. But the Justice Department is staffed with career attorneys committed to the rule of law—and in many cases protected by civil service regulations. It is not so clear that they can be browbeaten by the president. Plus, whether or not Trump can be indicted while still president, he will find himself in legal jeopardy after he leaves office. And then there are his aides and associates; if any of them have assisted Trump in his campaign to pressure the Justice Department, they are complicit in a crime.

The vast reach of federal criminal law and law enforcement leaves us vulnerable to the risk that Trump will use these resources for political ends, as he already seems to have suggested. But Trump is vulnerable to the same forces that he seeks to unleash on his rivals. In an effort to ensnare his opponents, he may be laying his own trap.