WITH its forbidding bulk and high walls, the former hostel for immigrants stands out amid the abandoned factories and jumble of railway lines of Brás, in the heart of São Paulo. Now a museum, between 1887 and 1978 it received 2.5m foreigners of 70 nationalities. After delousing and registration, most were swiftly hired to work on coffee plantations or other farms.

Like the United States, Latin America was once a region of immigration, forced and free. African slaves were sent in large numbers to Brazil and the Caribbean rim. Italians, Spaniards, Germans, east Europeans, Jews and Syrio-Lebanese all came, as did Japanese and Chinese. Many of Latin America’s biggest companies were founded by immigrants.

Transcontinental immigration tailed off by the mid-20th century, to be replaced in a few cases by movements within the region. Hundreds of thousands moved in the 1950s and 1960s to then-booming Venezuela from the other Andean countries. Bolivians, Paraguayans and Peruvians migrated to Argentina, southern Brazil or Chile. Some 400,000 Nicaraguans live in Costa Rica.

These migrations were gradual. Often, they met a demand for labour. But nothing in its past has prepared Latin America for the scale and suddenness of the exodus from Venezuela, in which some 2.3m people have moved to other countries in the region since 2014. Around half have gone to Colombia. Peru, Ecuador, Chile, Brazil and Argentina, in that order, have received most of the rest. Around 5,000 people continue to abandon Venezuela every day. Some fear political persecution by Nicolás Maduro’s dictatorship; many have simply had enough of hyperinflation, crime and collapsed public services. On a smaller scale, perhaps 25,000 Nicaraguans have sought asylum in Costa Rica (population: 4.9m) since its dictator, Daniel Ortega, began persecuting the opposition in April.

The vast majority of the newcomers have been well received. Unlike most refugees in Europe, no big differences of language, race, religion or culture separate them from host populations—though Portuguese-speaking Brazil is a bit less familiar. But it would be a mistake to conclude that their absorption will be easy.

Some have been the target of isolated episodes of xenophobia. In August locals at Brazil’s remote border with Venezuela attacked a migrant camp, expelling some 1,200 people. In the same month a hundred or so Costa Ricans staged an anti-refugee demonstration at Parque de La Merced in San José, their capital, where Nicaraguans congregate at weekends. Ricardo Belmont, a candidate for mayor of Lima in an election on October 7th, has repeatedly said he will “defend Peruvians” and their jobs from Venezuelans.

Fortunately, this is not the norm. In Costa Rica seven former presidents jointly called for Nicaraguans to be welcomed “with open arms”. Having once led in the opinion polls, Mr Belmont now looks like an also-ran in the election.

But there are two reasons to fear trouble. As Luis Alberto Moreno of the Inter-American Development Bank has pointed out, while the six European countries that have absorbed the most immigrants since 2014 have an average income per person of $46,500 in purchasing-power terms, the figure for their Latin American counterparts is less than $17,000. Solidarity among the poor can go only so far. Unlike Venezuelan emigrants earlier in this century, who were business people or professionals, many of the new arrivals will compete for unskilled jobs, perhaps depressing wages.

It would be a mistake, too, to assume a common identity. Many writers from the region have said that they only began to think of themselves as Latin American when they were in Europe or in the United States. Nationalism is a powerful force in Latin America. A brief war in 1969 between El Salvador and Honduras was triggered mainly by the harassment and expulsion of Salvadorean migrants.

All this underlines the urgency of a co-ordinated regional approach to the Venezuelan exodus, and international aid to help cope with it. Mr Moreno notes that it will cost Colombia around $1.6bn a year (or 0.5% of its GDP) to provide services for the new arrivals. The UN last month appointed a special representative for the Venezuelan migratory crisis. The United States has offered around $100m in emergency aid; a bipartisan bill in the Senate might add to that. The European Union has promised €35m ($40m). Much more will be needed. Alongside generosity should go efforts to recoup some of the money spent by seizing assets stolen by those in power in Venezuela.