MEXICO CITY — It was an intuitive prediction, supported by virtually every expert who had studied the subject: As the coronavirus pandemic caused the global economy to tumble, remittances to Mexico and Central America would crash.

It turns out the forecast was wrong.

Instead of collapsing, remittances to Mexico were up year-over-year in five of the first six months of 2020. In June, payments to El Salvador, Guatemala, Nicaragua and Honduras also increased compared with the same period in 2019, after a dip earlier this year.

In March, the month the World Health Organization declared a pandemic, remittances to Mexico topped $4 billion — a record.

“I remember thinking, ‘Oh, my God, what happened here?’ ” said Jonathan Heath, deputy governor of Mexico’s central bank. “It’s the exact opposite of what we were expecting.”

For years, the logic behind remittances — the payments that migrant workers send back home — was straightforward. As more people migrate and as economies in the developed world grow, remittances increase. During economic contractions, when immigrants are disproportionately vulnerable, remittances fall. So when the World Bank predicted in April that the pandemic would cause their “sharpest decline in recent history,” it seemed reasonable.

But that logic is now being thrown into question in countries such as Mexico, where new data continued the surprising trend: Despite the global economic decline, Mexicans received $3.53 billion in remittances in June — an 11 percent jump year-over-year.

“We understand the economics of migration and how people make decisions in times of crisis a lot less than we thought we did,” said Andrew Selee, the president of the Migration Policy Institute.

Elsewhere, the data is uneven. Migrants sent $2.6 billion back to Bangladesh in July, a record for any month in the country. “Remittances continue to defy all expectations,” Bangladesh’s Daily Star newspaper reported. The payments have also surged in Pakistan.

But in other countries, such as the Philippines, Tajikistan and Brazil, remittances dropped by double digits.

That unevenness has made explaining the resilience of remittances in Mexico and Central America even more difficult. At Mexico’s central bank, Heath and his colleagues have wrestled with various theories. Initially, they thought migrants might be wiring their savings back home before returning to Mexico. But as remittances remained high, and with little evidence of reverse migration, that appeared unlikely.

They debated another possibility: Mexican drug cartels were using remittances to launder money. But given the massive number of transactions and the relatively small sums, that also seemed improbable.

Another potential explanation: Many immigrants work in sectors — agriculture, construction, retail — considered essential, and have been able to stay on the job. But federal data shows that unemployment among foreign-born Hispanics in the United States has outpaced that of the general population.

For now, Heath’s best guess is that many Mexican immigrants who lost their jobs in the United States have benefited from a federal unemployment package, allowing them to continue sending money even after losing their jobs.

That income — and migrants’ recognition of the increasingly dire conditions for their families in Mexico — has led to an uptick in money transfers, he said. It’s significant, too, that the dollar is 13 percent stronger against the peso than it was one year ago.

“We were very worried about the possible drop,” Heath said. “For some states in Mexico, the reliance on remittances is very significant.”

Across the United States, migrants and the children of migrants say they have prioritized sending money to family in Mexico and Central America during the pandemic.

Carolina, 37, an undocumented farmworker in Palm City, Fla., sent $1,400 to her hometown in Huehuetenango, Guatemala, in July, three times her monthly transfer before the pandemic. She keeps the receipts next to her bed, with her sister’s name under the word “Beneficiario.”

“There’s more of a need to send now. I have relatives who can’t work. I have relatives who are sick and need a doctor,” she said.

“Last week my brother passed away, and now they need money for the funeral. These days I don’t keep any of my paycheck for myself.”

In Ulysses, Kan., Rebecca Giesbrecht and her husband invested their government stimulus checks in repairing her family home, so they could rent it out and send the proceeds to her parents in Chihuahua, Mexico. Her parents were deported in 2018; this year, Giesbrecht, 23, has sent them about $1,000 per month.

“They have needed doctors’ visits and vehicle repairs, and basically as things come up, we do what we can,” Giesbrecht said.

Outside Centralia, Ill., Guillermina Sánchez added an extra $200 to the small sum she sends to her elderly mother each month in Michoacán, Mexico. Her mother’s small business selling corn closed during the country’s outbreak.

“She can’t do anything during the pandemic,” Sánchez said, “so we’re helping more.”

In June, the unemployment rate for foreign-born Hispanics in the United States was 13.5 percent, even though many did work deemed essential. The rate for all groups was 11.2 percent. Undocumented immigrants are not eligible for government unemployment benefits.

Since 2009, the average savings for Mexican migrants has increased from $4,000 to $6,000, giving them a slightly bigger cushion to continue sending remittances during an economic downturn, said Manuel Orozco, who studies the phenomenon at the Inter-American Dialogue.

It’s impossible to determine how many undocumented workers, such as Carolina, continued earning the same income while sending home significantly more. Analysts believe one takeaway from the surprising data is that migrants are able to promptly prioritize supporting their families during difficult times.

Similar data emerged during the 2014 Ebola outbreak, when the West African diaspora sent more money home to Liberia, Guinea and Sierra Leone. Remittances also surged in the wake of the 2010 Haiti earthquake.

“Migration is health insurance, it’s unemployment insurance, it’s a giant risk mitigation strategy for the world’s poor,” Selee said. “So there is a countercyclical component to it.”

The Economic Commission for Latin America and the Caribbean expects Mexico’s economy to contract by 9 percent this year. El Salvador is expected to fall by 8.6 percent, Nicaragua by 8.3 percent, Honduras by 6.1 percent and Guatemala by 4 percent.

The informal sectors in those countries — laborers, maids, street vendors — have suffered immense unemployment with almost no government support. Mexico now has the third- most coronavirus-related deaths in the world, and some hospitals have been overwhelmed for months. Many people rely on private clinics, pharmacies and — if they can afford them — hospitals for medical care. Those costs are often covered by remittances.

In Mexico, migration expert Michael Clemens wrote in May, “a 20 percent cut in remittance income would cause roughly 800 additional deaths of children under age one each year.”

Though such a decrease hasn’t happened yet, economists are alert to the possibility that a fall could still lie ahead, if economic conditions in the United States deteriorate.