China East Africa Railway
Rwanda's President Paul Kagame, Chinese Premier Li Keqiang, Kenya's President Uhuru Kenyatta, Uganda's President Yoweri Museveni and South Sudan's President Salva Kiir (L-R) pose after signing the Standard Gauge Railway agreement in Nairobi. Reuters

The sight of a high-ranking Chinese official standing alongside African leaders is becoming a familiar one. Pleasantries lead to talks lead to photocalls. These are usually followed by press conferences where a grateful African leader praises China's generosity, a Chinese leader will stress the mutual benefits of the partnership, and both sides will have a dig at old colonial powers' legacies in Africa.

The announcement that a Chinese bank will back a new railway venture in Kenya was one of these occasions. This particular project, to build a line connecting Kenyan cities Mombasa and Nairobi, will cost in the region of $3.8bn (£2.3bn, €2.8bn.) The line will link to Kampala in Uganda, Kigali in Rwanda, Bujumbura in Burundi and Juba South Sudan.

China's Eximbank will put up 90% of the costs, with Kenya covering the remainder. What's more, a subsidiary of the Chinese Communications Construction Co has been named as the main contractor.

The benefits for Kenya are obvious. Transportation costs are a crucial issue, weighing down growth across most of East Africa. The Nairobi government wants to bring those costs down.

Kenyan president Uhuru Kenyatta said it would be the biggest infrastructure project in post-colonial Kenya. There is no way that Kenya could fund this kind of project without outside investment. It simply does not have the cash flow.

As is the case with much of China's investments dealings across Africa, there was no obvious sign of what China would gain.

Premier Li Keqiang told reporters: "The project demonstrates that there is equal cooperation and mutual benefit between China and the east African countries, and the railway is a very important part of transport infrastructure development."

There is a naive assumption among some that China's African investments are mere gifts without political strings attached, a rich country sharing its considerable wealth with a less fortunate continent.

Undoubtedly, the Chinese leadership is happy for that view to rise to the surface but in reality, the Sino-African relationship is driven by economics.

In the aftermath of Angola's civil war in 2002, China eagerly provided vast amounts of finance to Africa's second largest crude producer. The loans were backed by that very commodity that China, an industrial powerhouse, desperately needed to grow its economy. The Chinese premier visited the oil-rich state last week where a number agreements were signed, but not disclosed.

While those deals have obvious benefits on both sides, the rail project is not as clear-cut. It's a long-term investment, with long-term returns. Like its dealings with Angola, China is most likely to be looking at resources but in this case, over a longer period.

The construction will undoubtedly foster goodwill. With its vast investment in media and now long-term infrastructure projects, China is committing itself to the risky continent for decades to come.

A line linking five east African countries would make it easier for China to gain access to resources across a vast area of the continent. The Kenyan government has offered the Chinese something. Although it is not clear exactly what that is at the moment, it will become clear as the long-term relationship unfolds in the coming years.