The US is currently facing a government shutdown because Donald Trump is insisting any spending bill must fund the construction of a US-Mexico border wall, which would cost as much as $18 billion.

Bound up in symbolism about the racial purity of the United States, the wall has been sold as a way to prevent both illegal immigration and the trafficking of drugs over the southern border. But the actual solution to securing the border against drug smuggling may be simpler and cheaper than Trump realizes: Rather than stop the flow, why not just grow the drugs here?

In a paper published late last year in The Economic Journal, economists Evelina Gavrilova and Floris Zoutman and sociologist Takuma Kamada found that the creation of a domestic marijuana industry—in the form of legal markets for medical marijuana—led to a 12.5% reduction in violent crime in US states bordering Mexico.

The researchers were testing a fairly simple hypothesis: Introducing legal marijuana markets decreases the revenue that drug-traffickers earn from smuggling illicit substances. In turn, that reduced revenue leads them to invest less in crime.

The creation of a domestic marijuana industry led to a 12.5% reduction in violent crime in states bordering Mexico.

The authors used federal records to track crime rates over time as different states introduced laws to allow limited marijuana use, and found significant reductions in drug-related assaults, robberies and murders. The effects are concentrated in border states, where cartels engage in disputes over smuggling routes and territory. But the authors found that medical marijuana laws in inland states effectively reduced violence in border states by reducing the profitability of criminal drug smuggling.

Two other papers cited by the researchers, one on the price of corn in Mexico and the other studying the seizure of cocaine in Colombia, suggest a similar linkage between falling revenues and falling crime. When Mexican farmers were incentivized to grow more corn than marijuana, violence dropped as revenues to drug organizations fell. When officials in Colombia, a major source of cocaine exported to the US through Mexico, increased seizures, the price of the commodity rose and so did drug violence.

These results back up decades of anecdotal evidence that suggest policies that target the supply of drugs don’t deter crime, but only increase their price and thus the incentive for trafficking. Effective interventions to reduce crime appear to divert producers into alternate lines of work, like growing corn; reduce demand for addictive substances through treatment; or, in the case of medical marijuana laws discussed here, by offering legal alternatives to purchasers.

The data used by these researchers is from 1999 to 2012, which means it misses out on the more recent boom in states legalizing medical or even recreational marijuana. But the authors believe that the larger recreational markets created in Colorado and Washington shortly after the study period would have driven down crime even further. They also believe that Florida’s recent decision to allow medical marijuana will decrease the ”decrease the crime rate in Texas by 60 crimes” annually because Texas is a key pathway for marijuana into the country.

The researchers tested their assumptions with several different checks, including excluding major cities, excluding counties where the FBI needed to make assumptions to fill in crime data, and controlling for different types of medical marijuana law. In each case, they found their hypothesis held up.

This model for understanding how drugs cause crime may seem intuitive, but it hasn’t found any place in the supposedly tough-on-crime Justice Department. There, attorney general Jeff Sessions is cracking down on state-regulated marijuana markets. Doing so at the same time as a new border wall is constructed suggests a strategy for increasing, not decreasing, drug crime: Marijuana prices are likely to rise, making smuggling operations even more lucrative and the battle to control them even more violent.

Indeed, the researchers begin their paper with an anecdote reported by the New York Times in 2012, when a former DEA agent described what happened when the US built a high-tech border fence.

“They erect this fence only to go out there a few days later and discover that these guys have a catapult, and they’re flinging hundred-pound bales of marijuana over to the other side,” the agent said. “We’ve got the best fence money can buy, and they counter us with a 2,500-year-old technology.”