ON FRIDAY, after a 7-year-old girl died in Border Patrol custody, a White House spokesman called on Congress to “disincentivize” Central American migrants from undertaking the perilous northward trek to the United States. In fact, there is just such a plan in the works, one already presented to President Trump, that has the makings of an effective long-term strategy for reducing the migrant flow, as well as tensions at the border. Mr. Trump would be wise to embrace it.

The plan is the brainchild of Mexican President Andrés Manuel López Obrador, who was sworn into office Dec. 1. He has proposed what amounts to a Marshall Plan for Central America — $30 billion over five years in job-creating economic development assistance. The details remain unknown, but the idea is eminently sensible: Along with insecurity and gang violence, the major driver of migration from Honduras, El Salvador and Guatemala is a massive opportunity deficit.

Mr. López Obrador outlined his vision to Mr. Trump on the phone recently and solicited U.S. participation. No word yet from the White House on the president’s response. However, incensed by the convoys of Central American migrants that made their way to the southern border this fall, he has specifically threatened to close down the border and sever existing aid to Central America, which amounts to hundreds of millions of dollars annually. And his usual instinct on foreign aid is: Why should we?

As it happens, there’s a compelling answer to that question, which the president himself has thrust into a spotlight by pushing to have Central American asylum seekers remain in Mexico while their cases work their way through U.S. courts. If Mr. Trump signs on to Mr. López Obrador’s vision for reviving Central America with an ambitious aid plan — one that would also serve U.S. interest as a means to “disincentivize” migration — that could be just the sweetener Mr. López Obrador needs to go along with Mr. Trump’s asylum plan.

This could be the start of a beautiful friendship, or at least a constructive alliance, between a pair of populist presidents who happen to be ideological opposites but whose goals on Central American migration should be aligned. Like Mr. Trump, Mr. López Obrador has his own reasons to discourage migrants who, in the case of the thousands who have reached Tijuana with the caravans, have become an increasingly unpopular local irritant. And even before the caravans, those who traversed Mexico were a magnet for exploitation and crime at the hands of human traffickers and other predators.

Hundreds of miles of existing barriers at the border haven’t stopped the flow of migrants, and neither will Mr. Trump’s wall, if it is ever built. The most effective long-term way to tackle the migrant problem is to do so at the source, in Central America. Mr. López Obrador is on the right track in grasping that. Mr. Trump would do well to join him, and strike a deal that would advance both leaders’ agendas.

Read more: