Last week, President Trump confirmed the fears of many late 18th-century Americans when he suggested that former secretary of state John F. Kerry had violated the Logan Act, a 1799 law that prohibits ordinary citizens from negotiating with foreign powers.

Trump suggested that Kerry often “speaks to” the Iranians and “tells them not to call. That’s a violation of the Logan Act, and frankly he should be prosecuted in that, but my people don’t want to do anything that’s — only the Democrats do that kind of stuff.” Trump’s swipe at “the Democrats” probably referred to the fact that many Americans, including Democrats, have accused his former national security adviser Michael Flynn of violating the Logan Act during the presidential transition period.

Notably, though, Trump’s assertion that Kerry “should be prosecuted” under the terms of the Logan Act repudiates its very goal: removing partisan influence from diplomacy. In fact, this threat of prosecution legitimizes the very fear of the law that its detractors voiced: that in its attempt to curb partisanship, it actually invites opportunities to inflame partisan tensions.

The Logan Act was passed after a doctor named George Logan crossed the Atlantic Ocean to negotiate with the French government in 1798. Despite having no formal credentials or authority, Logan hoped to bring an end to a diplomatic dispute between France and the United States. His efforts were ultimately unsuccessful, but in the highly partisan climate of the late 1790s, his actions aroused considerable interest and anger.

Franco-American diplomacy had become a particularly contentious issue. Led by Thomas Jefferson, the Democratic-Republican Party (known as Republicans) was sympathetic to France — so much so that opponents often referred to its members as “Jacobins.” The Federalist Party, led by President John Adams, was much more suspicious about France and closely aligned with Britain. The result was a rancorous partisan debate in 1795 when the Federalist government negotiated a friendly treaty with Britain, known as the Jay Treaty. Tensions boiled over again in 1798 after French diplomats apparently demanded a bribe to negotiate with American envoys.

By the late 1790s, many American leaders had come to fear that the nation’s diplomacy had become too entangled in partisan politics. To his detractors, Logan’s mission seemed to be a dangerous example of this. Logan was a well-known Republican in Pennsylvania. Early newspaper reports about his mission described how the French government had “received an agent (Dr. Logan) from the Jefferson party” and how “Logan had arrived [in Paris] from Jefferson and his party.”

With Logan’s example fresh in Federalists’ minds, a bitter debate ensued in Congress. Federalist James Bayard worried that if a person like Logan negotiated a treaty on his own behalf, one party might say it should be accepted and the other that it should not, which “might involve the country in a civil war.”

Supporters of the Logan Act also argued that Logan was acting in the interests of his party, rather than the interests of his country. Federalist Robert Goodloe Harper, for example, denounced him as the “envoy of a domestic faction” who was directing France in the proper methods of “influencing our elections.” In other words, Harper accused Logan of not only negotiating with France, but also coordinating with it to improve his party’s chances in the next election.

Opponents agreed that the Logan Act was primarily concerned with regulating partisan behavior. But instead of seeing it as a benevolent effort to disentangle diplomacy from poisonous partisanship, they saw a far more sinister motive at work: creating a new tool for prosecuting the Republican opposition. A Virginia Republican named Carter Harrison argued that the “law is principally intended for party purposes” and to “bring an odium on” Republicans. Albert Gallatin, one of the Republican leaders in the House of Representatives, claimed that the law would be deployed in partisan ways: “If a man is a federalist, he will be innocent, but if he is an anti-Federalist [Republican] he will be guilty.” They feared that Republicans might be prosecuted for innocently corresponding with friends abroad or speaking with a foreign government in pursuit of their own interests.

These dire scenarios did not come to pass. Only two people have ever been prosecuted on suspicion of violating the Logan Act, and neither was convicted. Nevertheless, the law has remained on the books. Modern partisans regularly accuse their enemies of violating it. In 2015, for example, Democrats and progressive activists charged Sen. Tom Cotton (R-Ark.) with violating the Logan Act when he organized congressional opposition to President Barack Obama’s nuclear deal with Iran. During the 2016 election, Secretary of Agriculture Tom Vilsack (D) accused then-candidate Donald Trump of violating the Logan Act by encouraging Russian actors to hack Hillary Clinton’s email account.

The law’s opponents feared it would become a partisan weapon, and it has.

Even while claiming to enforce the Logan Act, Trump is proving that point. He is violating the spirit of the law by turning diplomacy into a partisan fracas. If he truly cared about the Logan Act, he would focus on removing partisanship from foreign policy to the greatest extent possible, not wielding the law to attack his detractors.