Mexicans living abroad sent cash home in record numbers last year. The vast majority of the cash came from those living in the United States.

Two main forces drove the trend: Mexico's weak currency, the peso, and President Trump's threat to slap a tax on cash shipments, known as remittances, sent from the U.S. to Mexico.

Mexicans sent home $26.1 billion from January to November 2017, according to figures released Tuesday by the central bank of Mexico. That's the most ever recorded and better than the $24.1 billion sent in 2016 over the same period.

Barring a major setback in December, the total annual figure for 2017 is on pace to hit another record high.

Remittances are one of Mexico's top sources of foreign income, outpacing oil exports, which totaled $18.5 billion between January and October, according to the most recent figures available at the Bank of Mexico. Manufacturing exports are the top source of foreign income for Mexico.

Related: Argentina's peso got hit again in 2017

Mexico's peso is one of the main drivers of the trend. It remains slightly above its all-time low hit in January 2017. One dollar is worth about 19.50 pesos.

The peso plunged after Trump won the 2016 election, triggered by fears that he would tear up NAFTA, the trade agreement, or impose tariffs on Mexican exports north of the border. Those fears haven't been realized and the peso is starting 2018 up slightly from where it began last year.

Trump specifically threatened to slap a tax on Mexican remittances to pay for his proposed border wall. Economists say that particular threat has also encouraged Mexicans to send money home before any restrictions are put in place.

Experts add that the devastating earthquake in and around Mexico City in September likely caused Mexicans to send extra cash home last fall to loved ones trying to recover and rebuild.

Remittances in October hit $2.6 billion, the highest for any month last year, according to Mexico's central bank.

Some of Mexico's poorest states tend to receive the most in remittances, making the extra cash a key source of income for millions of Mexicans living in poverty.

Correction: A previous version of this story incorrectly stated that remittances are Mexico's top source of foreign income.