Russia’s parliament has agreed to write off about $10 billion of North Korea’s Soviet-era debt, in a deal expected to facilitate the building of a gas pipeline to South Korea across the reclusive state.

Russia has written off debts to a number of impoverished Soviet-era allies, including Cuba. North Korea’s struggling communist economy is just 2 percent of the size of neighboring South Korea’s.

The State Duma lower house on Friday ratified a 2012 agreement to write off the bulk of North Korea’s debt. It said the total debt stood at $10.96 billion as of Sept. 17, 2012.

The rest of the debt, $1.09 billion, would be redeemed during the next 20 years, to be paid in equal installments every six months. The outstanding debt owed by North Korea will be managed by Russia’s state development bank, Vneshekonombank.

Russia’s Deputy Finance Minister Sergei Storchak told Russian media that the money could be used to fund mutual projects in North Korea, including a proposed gas pipeline and a railway to South Korea.

Russia’s state-owned top natural producer Gazprom, has long planned to build a gas pipeline via North Korea to South Korea with a view to shipping 10 billion cubic meters of gas annually.

Moscow has been trying to diversify its energy sales to Asia away from Europe, which, in its turn, wants to cut its dependence on Russian oil and gas.