Russia has written down $32 billion of Cuba’s Soviet era debt. Russian President Vladimir Putin signed the law ahead of his official visit to Latin America, with Havana as his first stop.

The agreement was first signed in October 2013 and draws a line under a twenty-year dispute.

Cuba is now required to pay back $3.2 billion over the next 10 years.

The first payment from Cuba is expected in October, and the money will be transferred to an account of the Russian lender Vnesheconombank opened at the National Bank of Cuba.

The agreement was signed into a law on Friday ahead of Russian President Vladimir Putin’s official visit to Latin America, where Cuba comes the first.

Cash-strapped Cuba has been feverishly trying to restructure its debt to jump start its economy and attract investment. Three years ago it restructured $6 billion it owes to China, and in 2012 Japan forgave about $1.4 billion.

Mexico recently forgave $478 million of Cuban debt, and Havana agreed to pay back $146 million over 10 years.

Cuba’s total debt was officially estimated at $13.6 billion in 2012 which is described as “active”. Other debt collected prior to its default in 1980s is referred to as “passive”.

Cuba remains a strong ally of Russia, with trade between the two countries at about $200 million last year.

After the Soviet Union broke up Russia became the legal successor to Cuba’s loans. Cuba in turn rejected this, saying that the debt was in a currency that no longer existed, and was to a country that had vanished.

Putin’s 'big tour'

The next stop following Havana will be Buenos Aires. Argentina’s President Cristina Fernandez de Kirchner has been very supportive of Moscow in its stand-off with the West, and regrets that trade with Russia hasn’t been better. The two leaders aim to increase the annual $1.8 billion turnover, but its energy deals where both hope to gain a lot. A fifth of Argentina's power is provided using Russian technology, and a new multibillion dollar nuclear power plant which is expected to be built by Russia’s state-owned energy firm Rosatom will certainly increase that.

Last, but certainly not least, is Brazil. Not only will Putin be lucky enough to witness the World Cup final from the stands - and go through a symbolic handover of the Mundial from Brazil to Russia - he has a lot to discuss with Dilma Rouseff.

Brazil is Russia's key trading partner in Latin America and the two leaders share a common view on US wiretapping scandals - President Rouseff was one of the world leaders whose phone was hacked by the NSA. So a joint information security project will be on the agenda.

Here Putin will also meet a dozen Latin America presidents in hope of striking new partnerships.

The tour will culminate with the BRICS summit, where the final bricks of a joint development bank will be laid. The new financial body that’ll focus on infrastructure projects will have a $100 billion budget, and could represent a solid attempt by developing economies to become less dependent on loans from such international organizations as the International Monetary Fund and the World Bank.

The BRICS countries are also expected to sign an additional $100 billion fund to steady the currency markets, a buffer that’ll provide for quick currency to compensate for massive capital outflows. Russia’s finance minister has already dubbed the body as a “mini –IMF.”

Russia will also propose to set up a BRICS energy association that will include a fuel reserve, as well as an institute for energy policy.