Wracked by drug wars and corruption, Mexico is in a state of crisis. If Trump wants a secure border, he should help stabilize, not isolate, Mexico.

On Tuesday, the U.S. Supreme Court heard oral arguments in Hernández v. Mesa, a case involving a U.S. Border Patrol agent who fatally shot a Mexican teenager on the El Paso-Juárez border in 2010. The case presents some complex legal issues like whether a foreign national shot on foreign soil is entitled to Fourth Amendment protections, or whether the family of the Mexican teenager even has standing to sue in federal court.

But the facts of the case demonstrate just how complicated our problems have become along the U.S.-Mexico border, and how President Trump’s proposed solutions, like a border wall and mass deportations, won’t solve them.

First, some context. From 2008 to 2011, Juárez was embroiled in a horrifyingly violent drug war between law enforcement and rival drug cartels that claimed the lives of more than 10,000 people. In the summer of 2010, when killings in the city averaged about a dozen a day, U.S. Border Patrol Agent Jesus Mesa was on patrol near a cement culvert that divides Juárez from El Paso, Texas. He saw Sergio Hernández Guereca and a few other teenagers running toward the American border fence, and tried to apprehend them.

Hernández’s family claims he and his friends were just playing around, daring each other to run up and touch the American border fence. On the other hand, Justice Department records show that Hernández had twice been arrested for smuggling aliens across the border into the United States. It’s unclear what happened next, but it ended with Mesa shooting Hernández. He fired from the American side of the border, and Hernandez fell dead on the Mexican side.

A Single Metropolis, Divided By A Border

It’s a tragic story that underscores the seemingly impossible task facing the U.S. Border Patrol. El Paso-Juárez isn’t really two cities but a single integrated metropolis with an international border running through the middle.

A constant stream of traffic flows between the two cities, which have a combined population of more than 2.5 million—the largest metro region on the U.S.-Mexico border with the largest bilingual and binational workforce in the Western Hemisphere. The economy is highly integrated, thanks in large part to NAFTA, with students and workers commuting between the two cities every day and tariff-free raw materials flowing to factories in Juárez (called maquiladoras) and assembled goods coming back to the United States.

But El Paso-Juárez is also a schizophrenic place. For years, Juárez has been among the most violent cities in the world, while El Paso has been one of the safest in America. After a recent lull in violence, Juárez appears to be poised on the brink of another gang war. In the first two weeks of February, there were at least 40 homicides in Juárez, most of them execution-style. Besides the endless fighting between law enforcement and rival drug cartels, as well as rampant corruption, the city is also a hub for the lucrative and burgeoning black-market industry of human trafficking.

So how do you solve security problems in a place like this, where crime and corruption rule one side of the border and strong incentives draw a host of people, good and bad, to the other side? Is there a way to fix the border without destroying its economy, spending billions in U.S. tax dollars, and tearing apart families in Texas and Mexico?

One thing is certain. A heavily militarized border—Trump’s wall and deportation scheme—might marginally stem the flow of criminals and drugs, but it would also halt the flow of workers and goods, impoverishing communities on both sides. Of course, the most motivated criminal cartels would also figure out a way to get across anyway.

Trump is correct in one sense, at least. This is indeed a national security problem. But if we’re going to think and speak of the U.S.-Mexico border in such terms, we need to be honest about the root of the problem: the decay of civil society in Mexico and the virtual absence of the rule of law.

America Has a History Of Imposing Order on The Border

There’s an historical precedent for dealing with civil unrest and powerful criminal gangs in Mexico, but many Americans probably won’t like it. A hundred years ago, the Texas-Mexico border was a cauldron of violence and lawlessness. Beginning in 1910, the instability brought on by the Mexican Revolution metastasized into a series of clashes and cross-border raids that would become known as the Border War.

In 1916, the conflict escalated when Pancho Villa, the infamous Mexican Revolutionary general, launched a raid into Columbus, New Mexico. A garrison of U.S. infantry and cavalry repulsed Villa’s forces but the town of Columbus was heavily damaged in the fighting. In response, President Woodrow Wilson authorized the Pancho Villa Expedition.

Five thousand American troops led by General John J. Pershing entered Mexico with instructions to capture or kill Villa. Although they didn’t succeed in that effort, U.S. forces remained in Mexico until February 1917 to ensure the safety of American towns and settlements along the border and prevent future raids by Mexican Revolutionary forces.

The rationale behind the Pancho Villa Expedition, as well as earlier smaller-scale incursions by the U.S. military during the Border War, was rather straightforward: if civil unrest in Mexico is spilling across the border, then border security is a matter of national security. At the time, U.S. leaders concluded that if it takes unilateral military action to quell violence and restore the rule of law in Mexico, then so be it.

We Can’t Do This Without Mexico

At some point, we might have to have to revisit that rationale. Of course, this isn’t 1916 and the U.S. military certainly shouldn’t (and wouldn’t) unilaterally march into Mexico to impose law and order. But the Hernández v. Mesa case demonstrates just one of the problems with trying to police a highly porous border using conventional tactics. The ongoing drug wars, corruption, seemingly intractable human trafficking industry, and the growing number of families and unaccompanied minors fleeing Central America to enter at border checkpoints are all problems that Trump’s proposed solutions—a border wall and mass deportations—simply aren’t going to solve.

The cartels won’t be deterred by a wall, but they might be deterred by U.S. forces on their side of the border. Trump reportedly mentioned the possible deployment of American troops to Mexico in a phone call with Mexican President Enrique Peña Nieto earlier this month. But of course troops alone wouldn’t be enough. The U.S. would have to get serious about investing in Mexico’s long-term stability. That means more trade, not less, and better coordination with Mexico’s military and law enforcement agencies. After all, a stable and secure Mexico is in America’s best interest.

But all of this will require better U.S.-Mexico relations, which at the moment appear to be tanking. Secretary of State Rex Tillerson and Homeland Security Secretary John Kelly arrived in Mexico Wednesday to meet with Peña Nieto in hopes of soothing tensions over Trump’s executive order on deportations. That’s a good first step, but it should never have been necessary—and Trump himself will need to do more to repair the damage he’s already done.

If Trump really wants to do something about the cartels that are undermining the rule of law in Mexico, he’ll need Peña Nieto’s cooperation, or at the very least his acquiescence. With Mexico vowing to resist Trump’s border policies, acquiescence—let alone cooperation—seems unlikely right now.

That means things in Mexico are going to get worse before they better, which is bad news for us all.