Chinese state-owned banks loaned $22.1 billion to Latin American countries last year, helping to keep afloat struggling economies that have been hit hard by a fall in prices for oil, minerals and other commodities that they export, according to new numbers released Thursday by the U.S. think tank the Inter-American Dialogue.

That annual loan total is the second highest in a decade, behind only 2010, and surpassed combined loans to the region from multilateral lenders the World Bank and the Inter-American Development Bank, the data show. China loaned $8.6 billion to Brazil, $7 billion to Argentina, $5.7 billion to Venezuela and $821 million to Ecuador in 2014.

Despite its slowing economy, China has emerged as a lender of last resort for Latin America countries that had ridden a decade-long boom in Chinese demand for commodities but are now seeing budget deficits grow and currencies slip as Chinese appetite slackens.

Many traditional lenders are reluctant to take on the risk of financing countries such as Argentina and Venezuela due to their histories of default, nationalizations and high public spending.

Over the past two months, the presidents of Argentina, Ecuador and Venezuela have visited Beijing seeking more Chinese investments, and left with billions of dollars in commitments. Over the past decade, China has loaned Latin American countries about $118 billion, with Venezuela alone receiving $56.3 billion, the Inter-American Dialogue data showed.

The big unknown now is how long that Chinese generosity will last, and whether China will continue supporting increasingly unstable governments such as Venezuela's, said report author Margaret Myers, director of the Inter-American Dialogue's China and Latin America program. At least for this year, China has indicated it will offer another $25 billion to $30 billion in credit to the region, Myers said.

"It was an important year in 2014 that despite slowing growth we saw considerable commitment to the region," she said. "There's been a major promise of additional financing for the region, specifically for infrastructure. The question is who it will go to."

In 2014, Brazil's loans from the China Export-Import Bank, the Bank of China and the Industrial and Commercial Bank of China went to leasing oil rigs and purchasing equipment and financial services for the country's mining giant Vale.

The Chinese loans are also helping to pay for subway upgrades in the Argentine capital of Buenos Aires and dam construction in Ecuador and Argentina, the data show. In many cases, Chinese companies are overseeing the projects, and likely using Chinese workers, Myers said.

The Chinese financing often comes with generous terms, such as market-rate interest rates and favorable payback periods, and without the macroeconomic and good government reforms demanded by Western lenders, Myers said. Venezuela and Ecuador also pay off their loans by shipping millions of barrels of oil to China at market prices, an arrangement that's proved painful with recent plummeting oil prices.

With governments having largely failed to prepare themselves for the end of the China-driven commodities boom, Latin American countries are likely to see more pain — and need more help, said Kevin Gallagher, a Boston University international relations professor who helped compile the data.

Economic growth in Latin America and the Caribbean slowed to 1.4 percent in 2014. China's economy grew by 7.4 percent last year, compared to double-digit annual growth rates over the past two decades.

"The windfall for commodity prices over the last commodity boom was the biggest recorded in history, but the marginal savings rate was lower than in past booms," Gallagher said. "The South American resource countries are facing a real pinch."