MEXICO CITY (Reuters) - The United States is committing billions of dollars toward development in Central America and Mexico as part of a plan to strengthen economies in the region and curb illegal immigration, the U.S. and Mexican governments said on Tuesday.

Mexico's Foreign Minister Marcelo Ebrard announces a joint development plan between Mexico and the United States for the northern triangle of Central America, in Mexico City, Mexico December 18, 2018. REUTERS/Edgard Garrido

Mexican President Andres Manuel Lopez Obrador has been seeking to persuade U.S. counterpart Donald Trump to work with Mexico to develop Honduras, El Salvador and Guatemala, as well as Mexico’s impoverished south, to stem the flow of people.

Trump’s threats to slash aid to the region if illegal immigration is not contained raised doubts about how much the United States would provide, however.

Much of the new aid pledged on Tuesday is private investment that will depend on the viability of the projects and some of it was a reaffirmation of existing pledges.

But Tuesday’s announcement defied expectations among some skeptics who thought Trump, a Republican, and Lopez Obrador, a leftist, would clash.

“Finally, we see that Mexico and the U.S. are on the same page in understanding and tackling migration from Central America as a regional issue, not something that one country can handle on its own,” said Christopher Wilson, deputy director of the Mexico Institute at the Wilson Center in Washington.

Since much of the money will come through the Overseas Private Investment Corporation (OPIC) and will not cost U.S. taxpayers, it is “the creative solution that was found that makes this much more palatable to the Trump administration,” Wilson said.

Slideshow ( 2 images )

Mexican Foreign Minister Marcelo Ebrard said Washington is committing $5.8 billion to development in Central America and increasing public and private investment in Mexico via OPIC by $4.8 billion.

Of the OPIC amount, $2 billion would go to southern Mexico, he said. Ebrard’s government has pledged to find $25 billion to develop the south over the next five years.

“The agreements established here mean more than doubling the foreign investment in the south of Mexico from 2019,” the minister told a news conference in Mexico City.

Mexico and the United States have been in talks over what to do about Central American migrants moving through Mexico. Washington has pushed for Mexico to keep the migrants while their asylum claims are processed, but no deal has been struck.

The Mexican government has pledged to offer migrants work visas if they qualify to stay in the country and Lopez Obrador wants the United States to do the same.

Roberto Velasco, a spokesman for Ebrard, said in the coming days Mexico aimed to announce a change in immigration policy incorporating the existing plans for work visas for migrants.

The State Department said in a statement it wanted to recognize “Mexico’s willingness to develop a framework to ensure migration occurs in a legal, orderly, and safe manner.”

It said the two countries would organize a business conference early in 2019 to discuss investment opportunities.

The U.S. pledges include $1.8 billion Washington has spent or allocated between 2015 and 2018, as well as the budget requested for next year, the State Department said. The sums also incorporate OPIC’s current projects and potential pipeline worth $2.8 billion, and the U.S. government’s current Millennium Challenge commitments.

“We announced today that OPIC could make another $2 billion available for southern Mexico if commercially viable projects are presented,” a State Department official said.