President Trump is once again insisting that Mexico will pay for the “beautiful wall” he wants to build along the country’s border with the United States. On Jan. 18, he tweeted: “The Wall will be paid for, directly or indirectly, or through longer term reimbursement, by Mexico.”

Trump’s assertion that Mexico should pay for the wall stems from the incorrect but widespread belief that Mexicans are pouring into the United States. However, since the end of the Great Recession, more Mexican migrants have actually returned to Mexico from the United States than have entered it. According to the Pew Research Center, from 2009 to 2014, approximately 1 million Mexicans left the United States while only 870,000 Mexicans arrived.

Even more than Mexicans, Trump’s wall would target the thousands of Guatemalans, Salvadorans and Hondurans who have increasingly fled north to escape poverty and violence. In 2016, apprehensions of Central American refugees actually exceeded those of Mexicans.

When it comes to these Central American migrants, a wall already exists. And Mexico helped build it. In fact, Mexico is the wall.

Mexican officials have long supported U.S. efforts to curtail unauthorized Central American migration. In the 1980s, U.S. authorities started pressuring the Mexican government to increase immigration enforcement within Mexico so Central American refugees would never even reach the Mexico-U.S. border. In their efforts to maintain good relations with their more powerful neighbor to the north and to ensure that Mexicans could continue entering the United States, Mexican officials complied, converting their entire country into a border wall that keeps undocumented immigrants out of the United States.

They did so to help navigate the tricky issue of Mexican migration to the United States. From 1965 to 1986, Mexican migration north rose enormously. The number of Mexican citizens apprehended in the United States — an imperfect but suggestive measure of Mexican undocumented migration — jumped from 55,340 to 1,671,458. Given Mexico’s high rates of unemployment and underemployment, Mexican officials came to believe that their country’s economy depended on this migration. In 1979, Mexico’s secretary of foreign affairs, Jorge Castañeda y Álvarez de la Rosa, made this position clear to U.S. officials by explaining that the “800,000 Mexicans [who managed] to cross the border annually and stay in the United States at least for a temporary job” helped his government “to partially solve the problem of unemployment in Mexico.”

The Mexican government had not always supported out-migration. Up until the mid-1970s, most of Mexico’s top policymakers believed that a large population residing in Mexico was indispensable for economic growth, and they thus opposed long-term departures from the country. As Mexico’s economic problems mounted, however, policymakers came to see citizens’ migration as a potential solution to Mexico’s economic troubles.

From 1970 to 1976, consumer prices in Mexico doubled, and the country’s balance of payment ran a huge deficit. In 1976, Mexico’s president, Luis Echeverría, was forced to devalue the peso, ask for assistance from the International Monetary Fund and accept its austerity package. Although the Mexican economy recovered briefly with the discovery of new petroleum reserves in 1977, it plummeted again in 1982 after oil prices collapsed. That year, total employment fell by 0.3 percent and then again by 2.3 percent in 1983.

For Mexican politicians, citizens’ migration to the United States helped to alleviate political pressures from this escalation in unemployment.

U.S. officials used Mexico’s growing dependence on emigration to their benefit. In 1983, the U.S. government began to insist that Mexican authorities prevent the flow of Central Americans through their country. At the 1984 annual bilateral conference between Mexico and the United States, Secretary of State George Shultz warned Mexican officials that if Central Americans, who many U.S. citizens saw as communist rebels, kept arriving to the United States, his government would further fortify the U.S.-Mexico border — an action that would also impact Mexican citizens trying to enter the United States illegally.

Although Shultz never formally agreed to continue letting in unauthorized Mexicans, Mexican officials had no option but to accept his terms. Mexico’s secretary of foreign affairs assured Shultz that Mexican authorities had “the best disposition to help solve the [Central American refugee] problem as best they could.”

After meeting with U.S. officials in 1983, Mexican authorities took action. They sent more than 100 additional migration officers to refugee centers in Chiapas and made it harder for Central Americans to renew their tourist permits or to obtain other migratory documents in the interior of the country. In 1984, they heeded Shultz’s threats by further policing Central Americans’ routes north.

In 1986, the U.S. Congress passed the Immigration Reform and Control Act to tackle the issue of unauthorized migration. Although the law introduced measures that would make it harder for Mexicans to enter the United States, the Mexican government continued to curtail the flow of Central American migrants for the United States. Mexican officials believed that discontinuing the already established practice would enrage their northern neighbor, on whom they still depended.

Indeed, Mexico’s dependence on the United States increased in the 1980s as a group of Mexican government technocrats, many of whom were U.S.-educated, decided to improve Mexico’s economy by applying what they believed to be rational and efficient principles and techniques to running their country, including promoting free trade. These officials intensified efforts to stop Central Americans in Mexico; deportations grew tremendously from 14,000 in 1988 to 133,000 in 1991. Much like in 2015-2016, Central Americans during the 1980s were more likely to be deported from Mexico than from the United States.

Mexico has paid a high price for acting as a wall for the United States. Mexican officials looked like hypocrites for demanding guarantees for unauthorized Mexicans in the United States while denying those rights to Central American migrants. More significantly, their actions have helped to increase crime and violence in Mexico and to deny Central Americans basic human rights.

The Mexican government’s immigration crackdowns have forced Central Americans to travel through increasingly dangerous terrains within Mexico’s territory. Many are extorted, kidnapped, tortured, robbed, sexually assaulted or killed. Edmundo Salas, the head of inspection of Mexico’s Migratory Services, recognized that in the 1980s, Central Americans could reach the United States only after they passed “through a filter of organic extortion that was mounted by police authorities of all types (migration, state and federal police, municipal officers, and army), international gangs of undocumented smugglers, and those who provide tourist, hotel, and restaurant services.”

By the 2000s, the situation was much worse. In 2010, an estimated 60 percent of women migrating through Mexico were raped, and the bodies of 72 Central American migrants who had refused to pay extortion fees to a criminal ring were found in one of the largest single mass graves in the country. In 2012, a study conducted by the Washington Office on Latin America and Mexico’s College of the Northern Border estimated that 20,000 Central American migrants were kidnapped each year. The violence has not ceased.

Trump continues to insist on building a wall. Mexico can’t stop him, but it is time for Mexican officials to stop paying for the costs of the barrier that currently exists to prevent the flow of Central American migrants north.