Mexico City • In 1982, when gunmen attacked a police station in rural Peru, President Fernando Belaúnde Terry blamed guerrillas from the Shining Path and called the crime an act of “narco-terrorism — the union of the vice of narcotics with the violence of terrorism.” With that, he coined a term that fused two major nemeses of the United States — drugs and terrorism — into a single battle cry.

President Trump revived this idea in an interview last week with the former Fox News host Bill O’Reilly. “Are you going to designate those cartels in Mexico as terror groups and start hitting them with drones and things like that?” Mr. O’Reilly asked. “I don’t want to say what I’m going to do, but they will be designated,” Mr. Trump responded. “I have been working on that for the last 90 days.” He was referring to putting some of the cartels on the State Department’s list of foreign terrorist organizations.

Predictably, Mr. Trump’s comments were received with enthusiasm by hard-liners such as Representative Mark Green, who has called for the action in the past. “These cartels use barbaric ISIS and Al Qaeda tactics to murder and torture innocents, destabilize countries, and assassinate members of law enforcement,” he said in a tweet. And it sparked some protest south of the Rio Grande with the Mexican foreign minister, Marcelo Ebrard, declaring Mexico would not tolerate any “violation of its sovereignty” — meaning United States military strikes against cartels here.

The action fits comfortably into the president’s wider narrative of defending the southern border against dangerous foreign threats. But it could also lead to a series of far-reaching consequences, some of them dangerous.

The logic behind labeling drug cartels as terrorists is debatable but not outrageous. They do carry out widespread murder of innocent civilians. The massacre of nine dual Mexican and American citizens in Sonora on Nov. 4 inspired family members of the deceased to petition the White House calling for the terrorist designation.

United States legislation defines terrorism as being “politically motivated,” which some say should rule out drug traffickers, who care only about money. However, they do work with corrupt politicians, murder others and have a level of control over chunks of Mexico that could be considered political.

Designating a cartel as a terrorist organization could be used to beef up legal cases against them, as it was used against cocaine-trafficking guerrillas and paramilitaries in Colombia. But it could also be used to justify a military strike in foreign territory, as it has in places like Sudan and Pakistan.

Until recently, the specter of American troops firing shots in Mexico was seen as pure fantasy, the realm of films such as “Sicario.” But after the Sonora massacre, President Trump said in a tweet that the United States was willing to aid Mexico in “cleaning out these monsters.” Republican Senator Tom Cotton supported the idea, saying, “If Mexico can’t protect American citizens in Mexico, then we may have to take matters into our own hands.”

If American troops did storm the border to kill a few cartel members, it would not solve the problem here; there are thousands of gangsters with vast resources from trafficking drugs and a huge arsenal of weapons. But it would seriously inflame United States-Mexico relations and force President Andrés Manuel López Obrador into an excruciating position. This could undermine bilateral efforts to deal with the challenges of cartels, human smuggling and refugees.

On the flip side, terrorism laws could be used against those who play a part in the supply chain of American guns flowing to cartels, including “straw purchasers” and private sellers. Currently, some of those who break firearms laws to provide weapons to cartels get only lenient sentences including probation. But with the designation, they could be charged with providing material support to a foreign terrorist organization, which can warrant up to two decades in prison. It would be interesting to watch how the gun lobby would respond if a gun seller were hit with such charges.

Refugees who flee Mexican cartel violence would also have their cases bolstered in American courts. It is difficult for Mexicans to win asylum, because they are not fleeing a military dictatorship or official war zone, and usually don’t come from a persecuted religious group. But a judge could look more favorably on cases of those who were running from designated terrorists.

One of the toughest challenges for officials would be figuring out exactly which cartels to label as terrorists and what to call them. The cartels constantly change their names and fragment, and there are now dozens of gangs and splinter groups scattered across Mexico. Many of the traffickers and gunmen are only loose affiliates, and it could provide more headaches for agents trying to prove they are a member of a specific terrorist organization.

The cartels have unleashed a torrent of bloodshed in Mexico, and Washington should take a responsibility in trying to stop the humanitarian catastrophe. But the solution lies in tackling the big structural problems: reducing the billions of dollars that Americans supply by buying drugs; reducing the flow of guns; supporting efforts in Mexico to uplift marginalized communities; and supporting efforts to build effective police forces. There is no magic bullet or simple solution. Combining the complexity of Mexico and the catastrophic war on drugs with the problematic war on terror may only make it worse.

Ioan Grillo

Ioan Grillo is the author of “Gangster Warlords: Drug Dollars, Killing Fields, and the New Politics of Latin America” and a contributing New York Times opinion writer.