China and South Africa have inked deals worth $6.5 billion as the two countries aim to boost trade and investment. The agreements were reached during a four-day tour by Chinese President Xi Jinping to Africa.

As part of the 26 signed deals, China would lend $2.5 billion to South Africa’s state-owned rail operator.

Another $500 million loan will go to the state power company for nuclear cooperation improvement. The construction of a car manufacturing plant in South Africa is also among the agreements reached.

In exchange for Beijing’s loans, the African countries will provide China with oil and other key commodities.

Chinese Vice Foreign Minister Zhang Ming said that China and African countries “face unprecedented opportunities in terms of boosting mutual development as the two sides are embarking on a new phase of development.”

South Africa’s leader Jacob Zuma reiterated saying relations between the two countries were at their “best ever”.

Analysts view Xi Jinping’s visit as an attempt to assure African nations that China’s slowing growth won’t reduce its investment in the continent. On Friday he will co-chair a China-Africa cooperation summit in Johannesburg during which more multibillion-dollar loans are expected to be granted to African countries.