Venezuela is at the heart of the worst refugee crisis the world has faced since the Syrian civil war, which in 2017 culminated with an exodus of more than 6 million Syrians. Now, about 4.3 million Venezuelans—equal to 15 percent of those who remain in that country—have fled the ongoing economic and political collapse of their homeland. The United Nations projects that the number could rise to 5.4 million by the end of the year. Many have left legally as immigrants. Others are refugees and asylum-seekers. Still others are taking their chances crossing illegally.

Latin American countries have responded to the influx in increasingly harsh ways. After an initial open-door policy toward Venezuelan refugees, Ecuador and Peru imposed new border controls. Juan Sebastián Roldán, an Ecuadorian government official, claimed that his government’s new restrictions reduced the inflow from 2,000 daily crossings in August to about 50. And at the beginning of September, Peruvian Foreign Minister Néstor Popolizio claimed that Venezuelan migration had fallen by 90 percent since new controls were implemented in mid-June.

Ecuador’s and Peru’s restrictive policies will only push Venezuelans into making dangerous illegal crossings. And given the extent of this crisis, rather than trying to make the problem go away, it is time for Latin American countries to start planning how they’ll accommodate Venezuelans over the long term. Venezuelans need the opportunity to work, both to support themselves and to boost the economies of the countries they’re living in. Ultimately, accommodating these exiles will require that the host countries liberalize their economies so that they are able to absorb the new arrivals.

Recent economic research shows that it can be done. In new academic papers, one of the authors of this piece, along with other researchers, examined how Israel and Jordan adapted to separate massive refugee surges in the 1990s. In response, both countries were able to open their economies by doing things like lowering trade barriers, securing property rights, and reducing regulations.

For instance, the Jordanian government cut taxes on income and capital and proposed replacing the lost revenue with a national sales tax. The government did cut taxes but delayed the national sales tax for years, exempted many goods, and ultimately reduced the proposed maximum rate from 12 percent to 7 percent. It financed the cut in revenue by firing government employees instead. In Israel, the government embarked on a privatization bonanza.

As a result, according to the Economic Freedom of the World index published by the Cato and Fraser institutes, Israel’s economic freedom score rose from 4.48 out of a possible 10 in 1990 to 6.84 a decade later. Jordan’s rose from 5.43 in to 7.06 over the same period. And even though the Kuwaiti-Palestinians arrived in the midst of a severe recession, they helped boost Jordan’s economy. Right after the immigration surge ended in 1991, Jordanian GDP grew 1.6 percent in 1991 and 14.4 percent in 1992, marking the first time Jordan’s tax revenues covered its expenditures in the country’s history. This was not the tepid recovery that characterized past Jordanian economic recoveries, and the following investment boom helped solidify growth.

Israel’s economy also shot up, from an average annual GDP growth rate of 3.2 percent in the 1980 to 5.7 percent in the 1990s. The free market reforms, prompted by the refugee surge, made a big difference.

These cases offer plenty of lessons for today. In both, the scale of the challenge was enormous. Soviet Jewish refugees to Israel in the early to mid-1990s increased Israel’s population by 20 percent. At about the same time, the first Gulf War sent so many Kuwaitis of Palestinian descent to Jordan that it increased the country’s population by about 10 percent in a single year.

In both cases, moreover, cultural frictions between the existing populations and new arrivals were limited. Soviet Jews, although they were more secular than Israelis, nevertheless had some cultural and religious similarities with their hosts. Kuwaiti Palestinians were Sunni Muslim, spoke Arabic, and shared cultural attributes with Jordanians. Similarly, Venezuelan refugees speak the same language, generally practice the same religion, and share many cultural attributes with those in neighboring countries. These similarities help ease social frictions.

In the case of Jordan, the economic benefits of the reforms came very rapidly, which helped integrate migrants into the economy quickly and magnified the impact of the liberalization. In Latin America, the governments should likewise focus on reforms that will have immediate benefits.

There are, of course, differences from the earlier cases, but the main one works in Latin America’s favor. Venezuelan immigrant populations are large and growing, but they are still much smaller than the number of Soviet Jews in Israel or Kuwaiti Palestinians in Jordan. In Colombia and Peru, where the inflow of Venezuelans has been the highest, they currently amount to less than 3 percent of the population.

Going by the Israeli and Jordanian playbooks, Latin American countries would do well to start by liberalizing their labor markets. According to the Economic Freedom of the World index, Latin America has the most unfree labor markets of any region in the world. That is, it is legally more expensive for firms to hire or fire workers in Latin America than in other countries. In turn, firms hire much less since employers might be stuck with an underperforming employee forever. And beyond that, restrictive regulations have created huge black markets for labor. In Ecuador, 46.7 percent of the economically active population works in the informal sector.

For its part, Colombia, which has received more Venezuelan immigrants than any other country, ranks 107 out of 162 countries in terms of labor market flexibility. Its neighbors aren’t much better. To absorb the migrants, the Colombian government should deregulate labor markets, make it easier for employers to hire and fire workers, and make it harder for employees to sue employers over frivolous claims.

Host countries will also have to change many of their ID regulations, in particular border rules that typically require Venezuelan identity documents and police forms in order to enter the country in the first place. There’s no functional administrative state in Venezuela, so most migrants simply don’t have such documents. Similarly, even minimal visa fees are impossible for Venezuelans to afford after years of hyperinflation, which has whittled their cash reserves down to nothing. They have to work in order to pay the visa fees, but many can’t currently find legal jobs in the overregulated economies of Latin America.

Simply put, Venezuelans must be able to work legally in order to support themselves, and by doing so, they’ll also be contributing to the economies of their host countries. As the scenarios in Jordan and Israel show, economic liberalization can help host nations accommodate much larger flows of refugees while also leading to better outcomes for both exiled populations and the countries that absorb them.