China and Argentina signed a $9 billion currency swap agreement to boost the crisis-hit South American country’s foreign currency reserves, its central bank announced Sunday.

Struggling to recover after a currency crisis earlier this year, Latin America’s third-largest economy sought the assistance of the International Monetary Fund – which approved a $56 billion loan package.

The central bank said the swap deal will “contribute to greater financial stability and also facilitate trade” between China and Argentina.

A currency swap sees two parties agree to exchange a certain amount of foreign currency at a pre-determined rate, which protects against fluctuations.

Argentina’s central bank will be able to draw on these funds in an emergency.

The agreement followed the G20 summit in Buenos Aires, as Chinese President Xi Jinping was received by his Argentine counterpart Mauricio Macri for a state visit.

The two countries signed 30 trade and financial agreements.

“We are extending cooperation on economic, agricultural, financial and infrastructure issues,” Xi told a press conference.

After Brazil, China is Argentina’s second-largest trade partner.

In 2017, the relationship was firmly in Beijing’s favor: China exported $17 billion of goods to Argentina while importing $8 billion of goods from that country.

– With reporting from Agence France-Presse