Image copyright AP

China is planning to invest up to $50bn (£32bn) in Brazil for new infrastructure projects.

The deal is due to be signed by banks from both countries during a visit by Chinese Prime Minister Li Keqiang to Brazil next week.

The money will go towards building a railway link from Brazil's Atlantic coast to the Pacific coast of Peru to reduce the cost of exports to China.

It says the fund will also finance a joint venture to produce steel.

Brazil currently exports much of its iron ore to China.

Jose Graca Lima, Brazil's undersecretary of state with special responsibility for Asia and Oceania, said: "We shall have to await the end of the visit to expand upon which projects."

As well as the giant railway project, the money is expected to be invested in car parts, energy, ports, hydroelectric power and railways.

Brazil's economy, once among the fastest-growing in the world, has flagged in the past five years.

A corruption scandal at the state-owned oil giant Petrobras, which has embroiled many high-profile figures, has also shaken the public mood.

The Chinese prime minister will also be visiting Colombia, Peru and Chile.

In January Chinese President Xi Jinping pledged $250bn in investment to Latin America over 10 years.