A pro-migration activist argues with demonstrators during a protest against migrants who are part of a caravan traveling en route to the United States, in Tijuana, Mexico, on November 18, 2018.Carlos Garcia Rawlins / Reuters

On Sunday, U.S. Border Patrol agents used tear gas to disperse Central American migrants rushing for the fence separating San Diego and Tijuana. The Border Patrol maintains that agents found themselves under attack and that their response was measured and necessary. This is not the first such incident to have taken place in the vicinity. Almost exactly five years ago, a large assembly of border crossers made an attempt to rush across the Tijuana River channel into the U.S., throwing rocks and bottles at Border Patrol agents until the crossers were halted and pushed back, in part by the use of pepper spray.

One difference between then and now, however, is that while Mexican officials claimed no knowledge of the border-crossing incident then, perhaps out of a reluctance to seem too solicitous toward their U.S. counterparts, Mexican officials today are striking a notably different tone, emphasizing their own role in border security. As Andrés Manuel López Obrador, Mexico’s president-elect, prepares to take office on December 1, there are tentative signs that his government-in-waiting is open to striking a new migration bargain with the U.S.—one that could bring about a deeper, more fruitful partnership between the two countries. But for that to happen, President Donald Trump can’t expect to bully Mexico’s incoming nationalist government into submission. To have any hope of success, he must help López Obrador realize his vision of a more vibrant and prosperous Mexico that is very much the equal of the “colossus of the north.”

In the aftermath of Sunday’s border incident, the outgoing Mexican Interior Minister Alfonso Navarrete insisted that his government would move to strengthen security measures in Tijuana and Mexicali. Meanwhile, his designated successor, Olga Sánchez Cordero, who will serve under López Obrador, is in the midst of negotiating a “Remain in Mexico” plan with the U.S. government, which has the potential to greatly reduce the pressure on a U.S. asylum system that is in crisis. Though it remains to be seen if a deal will be done, it would represent a major breakthrough in U.S.-Mexican relations. The catch is that such a deal would have to be politically sustainable.

For both countries, the pressing issue is that a broken U.S. asylum system is fueling an accelerating cascade of Central American migration, which in turn is sparking anger and resentment in Mexico. A large majority of asylum seekers bound for the U.S. can demonstrate a “credible fear” of persecution if they were to return to their native countries, a permissive standard designed to screen out only the least plausible claims. This then gives them the right to go through a longer, more demanding evaluation of their asylum claims, after which only a small fraction are ultimately granted asylum by an immigration judge.

Given that most asylum claims are rejected, why do so many migrants file claims that are unlikely to pass muster? One answer is that merely filing a claim, even one that isn’t necessarily meritorious, has until now offered a tentative foothold in American life. The surge in asylum claims has led to a severe backlog. The sheer volume of asylum seekers is so great that only so many can be detained, and so they are typically released on bond. Parents with children can be held for no more than 20 days, which in turn has contributed to a sharp increase in the number of families with children at the border. Those whose case decisions are delayed are granted work authorization in the interim, a period that can last several years.

The result is that Central American communities in the U.S. have been growing considerably, and migrants who’ve established themselves beckon friends and relatives who have yet to join them. Though it is undoubtedly true that high levels of violent crime have been pushing people out of the Northern Triangle, even as homicide rates have declined in recent years, the pull of family ties and economic opportunity is at least as powerful a force. Drawing on World Bank data, the Pew Research Center found that remittances from migrant workers represented 17 percent of GDP in El Salvador, 11 percent in Guatemala, and 18 percent in Honduras as of 2016, numbers that have likely increased in the intervening years.

Yet as the anthropologist David Stoll has observed, it is important to emphasize that remittances do not flow evenly. Some households in the Northern Triangle have loved ones living and working in the U.S., while others do not, and the gulf between them stimulates further migration as have-not families seek to join the ranks of the haves by sending one of their own abroad. Migrants residing in the U.S. often send less money back home over time as their ties to their native country attenuate. Others struggle with a cost of living that can be punishing for those earning wages that, by U.S. standards, are very low indeed, and so they call for reinforcements. Over the course of several years, entire social networks can uproot themselves, and those seeking a decent life at home find themselves at a distinct disadvantage.

The Remain in Mexico plan would change this dynamic. Those asylum seekers who pass the credible-fear test would be expected to remain in Mexico while their cases are adjudicated. Exceptions would be made for those who can establish that they have a reasonable fear of temporarily residing in Mexico, but that would be a higher bar to clear. In practice, one of the main reasons Central American migrants prefer to live in the U.S. over Mexico is that, simply put, wages are higher north of the border, which is not in itself grounds for asylum. López Obrador has often expressed a desire to aid Central American migrants, and that has been echoed by Mexican officials who’ve pointed to job openings in the maquiladoras of Tijuana and other growing cities that could be filled by asylum seekers.

In an interview with The Washington Post, Sánchez Cordero underscored that “we want [Central American migrants] to be included in society, that they integrate into society, that they accept the offer of employment that we are giving them.” Elsewhere, she has discussed granting 1 million work visas to Central American migrants, in keeping with López Obrador’s concept of employing said newcomers in his efforts to revitalize southern Mexico. Though Remain in Mexico would not be a “safe third-country agreement,” which would essentially bar migrants passing through Mexico from applying for asylum in the U.S., it has the potential to bring an end to the periodic border crises that have roiled the country since the summer of 2014.

It is easy to see why such an arrangement would suit Trump, who could point to a more orderly southern border as the fulfillment, at least in spirit, of his campaign pledge to strengthen immigration enforcement. But what’s in it for López Obrador, whose chief objective is to combat Mexico’s entrenched poverty and therefore to ensure that, as he wrote to the U.S. president in July, not long after his election victory, “people find work and wellbeing in their places of origin, where their families, their customs, and their cultures are”?

So long as the answer isn’t pellucid, Remain in Mexico will either never get off the ground—a distinct possibility—or it will represent a tentative settlement, one that could be reversed at any moment. To secure Mexico’s lasting support, Trump must advance López Obrador’s domestic agenda. And the shrewdest way to do that, as I argue in Melting Pot or Civil War?, would be to allow U.S. retirees to make use of their Medicare benefits in Mexico.

As the U.S. population ages, demand for home health aides and other low-wage service workers who can provide for the elderly is increasing, and this rising demand is often cited by advocates of higher immigration levels. The trouble, of course, is that low-wage workers will one day age themselves, and their low incomes mean that they will need safety-net benefits and wage subsidies to lead decent and dignified lives on U.S. soil. Medicare-in-Mexico offers an alternative.

For years, U.S. retirees have been settling in Jalisco, Guanajuato, Baja Sur, and the Mexican Caribbean in large numbers, and they’ve been doing so despite the fact that Medicare does not cover health services outside of the United States, even if extending coverage would yield substantial savings for U.S. taxpayers. By covering health services for Medicare-eligible Americans in Mexico, the U.S. could generate employment opportunities for low-skill workers in Mexico, including Central American migrants. It might also meaningfully reduce Medicare expenditures, since the cost of offering benefits would be considerably lower in Mexico than in the U.S., as Marla Haims and Andrew Dick suggested in a 2010 report for the Rand Corporation.

Needless to say, such a proposal would surely be met with ferocious resistance from U.S. medical providers who fear the prospect of foreign competition, and their political allies would surely denounce it as part of a larger plot to export aging Americans en masse. But U.S. retirees are growing more diverse, and a large and growing number of them have origins in Mexico. Many of them would welcome the opportunity to reconnect with their ancestral homeland, provided that they wouldn’t have to surrender the promise of high-quality medical care in their twilight years in the process.

The benefits for Mexico would be immeasurable. Though export-oriented manufacturing has helped the country climb to upper-middle-income status, the truth is that low-skill, labor-intensive manufacturing won’t be enough to propel Mexico into the ranks of the world’s most affluent market democracies, not least because automation and offshoring to lower-cost locales will likely limit wage and employment gains. Further developing labor-intensive services, however, holds great promise for closing the still-yawning gap separating living standards north and south of the U.S.-Mexico border, and also for incorporating the recent Central American influx.

The very things Mexico needs to do to attract U.S. retirees in larger numbers—growing its English-speaking workforce, raising the quality of public services, and, most of all, improving public safety—would greatly improve the economic prospects and quality of life of its own citizens. Moreover, as Mexico develops a more advanced health-services infrastructure to serve the needs of U.S. retirees, other retirees would surely follow. Exotic though the idea of Mexico as a haven for retirees might sound, it is not unlike how Spain’s Costa del Sol has become a magnet for retirees from northern Europe, who’ve helped fuel the country’s economic growth for decades.

Taken together, Remain in Mexico and Medicare-in-Mexico would bind the U.S. and Mexico in a mutually beneficial relationship around immigration. Mexico would help the U.S. exert greater control over migration flows, and in exchange, the U.S. would make a serious commitment to fostering economic opportunity for Mexicans and Central Americans closer to home, thereby helping to keep families and communities intact. The presence of large numbers of older Americans in the region, meanwhile, will give the U.S. an even greater stake in helping maintain its security and prosperity, which would be all to the good.

The proposal is not without its complications. But the alternative is to keep lurching from crisis to crisis, and to hope that the many drivers of mass migration will simply fade away in the face of presidential bluster, as if by magic.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.