Jakarta. Bank Indonesia and Bank of Korea agreed on a $10 billion bilateral currency swap arrangement on Thursday, in a move meant to help protect the country from global economic shocks.

“This agreement is a commitment from both central banks to support regional macro-economic and financial stability in order to counter global uncertainty that is still at a high level,” Governor Agus D.W. Martowardojo said in a statement on Thursday.

The agreement allows either Bank Indonesia or Bank of Korea to swap Rp 115 trillion for 10.7 trillion won — both amounts equal to around $10 billion.

It will be effective for three years and can be extended if both parties agree to do so.

Bank Indonesia said that the swap agreement will improve trade and financial cooperation between the two countries.

Total non-oil and gas trade between the two countries reached $12 billion last year, up 0.4 percent from a year earlier, according to data from the Central Statistics Agency.

“Specifically, the agreement will guarantee trade settlement between the two countries in their respective local currencies even in a crisis situation,” the central banks said in the joint statement.

Bank Indonesia has been strengthening its second line of defense against a sharp fall in the rupiah, particularly with the Damocles’s sword of the US Federal Reserve’s tapering of its stimulus efforts hanging over the heads of emerging economies.

Last year Bank Indonesia beefed up its currency swap deal with the Bank of Japan — now doubled to $22.76 billion — and extended a 100 billion yuan ($16.5 billion) bilateral currency swap arrangement with the People’s Bank of China.

Currency swaps spare Bank Indonesia from using its precious foreign currency reserves to service trade or debt payments to countries it has swap deals with.

The rupiah fell 26 percent last year, triggered by hints from the Fed leadership of quantitative easing tapering, which prompted foreign investors to flee from emerging markets, particularly those with persistent current-account deficits, such as Indonesia.

The rupiah has since strengthened by 5.2 percent this year, as Indonesia’s current-account deficit has narrowed.

Meanwhile, Indonesia’s foreign reserves increased to $100.7 billion in February, their highest level in eight months.

Foreign investors have been collecting Indonesian assets since the beginning of the year, posing a risk to the rupiah.