As government regulators crack down on the financing of terrorists and drug traffickers, many big banks are abandoning the business of transferring money from the United States to other countries, a move that is expected to cost immigrants more to send money home to their families abroad.

While Mexico may be most affected — nearly half the $51.1 billion in remittances sent from the United States in 2012 ended up there — the broad retreat is hitting other countries in Latin America and parts of Africa as well.

The banks are being held accountable not only for the customers who directly use their money-transfer services but also for their role in collecting remittances from money-transmitting companies and wiring them abroad.

“This is transforming the business and may increase the costs of international money transfers,” said Manuel Orozco, a senior fellow at the Inter-American Dialogue, a research group in Washington, D.C.

JPMorgan Chase and Bank of America have scrapped low-cost services that allowed Mexican immigrants to send money to their families across the border.

The Spanish bank BBVA is reportedly exploring the sale of its unit that wires money across Latin America.

And in perhaps the deepest retrenchment by a bank, Citigroup’s Banamex USA unit has closed many of its branches in Texas, California and Arizona that catered to Mexicans living in the United States and stopped most remittances to Mexico as it faces a federal investigation related to money-laundering controls.

Regulators say the banking system was being exploited by terrorists and drug lords seeking to launder money. Regulators acknowledge banks must invest significantly more to monitor the money moving through their systems or face substantial penalties.

But the government’s efforts to root out illicit activity have effectively put the banks into a law-enforcement role, industry experts say.

And the result is undercutting another public-policy goal — helping immigrants move into mainstream banking. Even with the current, relatively low remittance fees, the costs can add up.

Manuel Santiago, a 48-year-old Mexican living in Queens, N.Y., said he sometimes pays $4 to send as little as $20 at a time to his son and daughter in Mexico.

A World Bank report found that the costs had been steadily falling over the last five years. But industry experts are expecting that trend to reverse.

A spokesman for Western Union, one of the largest remittance players, said it was among those capturing business from the banks.

While immigrants say they have not noticed broad price increases from companies like Western Union, industry experts say higher costs are inevitable with fewer banks acting as middlemen.

Even if banks invested in new software to screen for worrisome transactions, they would still have to manually investigate many suspicious activities and report them to regulators.

Banks fear that a single mistake could lead to costly penalties like the $1.9 billion settlement the British bank HSBC agreed to pay over money-laundering issues in 2012.

HSBC has stopped paying out remittances at its Mexican branches.

In reality, it may be nearly impossible to fully monitor money flowing through some parts of the world.

Regulators worry, in particular, about remittances to Somalia, a haven for terrorist groups with no formal banking system.

Banks in the United States have had to wire money to banks in Dubai.

Much of the money is then moved into Somalia through a network of traders.