It is 50 years since China first established a presence in Africa, forging diplomatic relations with Egypt. Beijing's courtship of African countries during the cold war was symbolised by its help in ambitious projects, such as the Tanzam railway between Tanzania and Zambia.

The venture was designed to show the world that China took its fraternal socialist responsibilities seriously and to demonstrate the existence of ideological and economic alternative to the US and the then-USSR.

Now China is cultivating ties in Africa not out of socialist ideals but out of economic necessity. The country's booming economy craves natural resources such as oil and minerals. Oil contracts have been signed with Nigeria and Gabon, while Chinese mining companies are setting up shop in South Africa to buy cobalt, copper, nickel and platinum in southern Africa.

The official Chinese press glosses over such economic imperatives in its reporting of Mr Hu's African tour. The China Daily quotes President Hu's four principles for the relationship between Asia and Africa: "Respect and support each other in politics, complement each other for common success in economics, learn from each other's strong points in culture, and maintain mutual trust, dialogue and coordination in security."

In other words, unlike western democracies, you won't hear us bleating on about human rights. We won't lecture you on the way you treat your citizens, we're here to trade for our mutual benefit. Thus Robert Mugabe of Zimbabwe, a pariah in the west, was greeted last year during a trip to Beijing as an "old friend".

Similarly, Sudan, another pariah state for the atrocities occurring in Darfur, is also treated as a friend because China buys Sudanese oil.

This pragmatic, cold-eyed approach to diplomacy raises some hackles in the west, particularly with human rights groups, but goes down well in countries such as Kenya, which has been come in for considerable stick for corruption.

On the face of it, China's application of realpolitik puts it at odds with that self-proclaimed beacon of democracy and freedom, the US.

But the Bush administration makes its own compromises with unpleasant regimes. Mr Bush this week will welcome Ilham Aliyev, the autocratic ruler of energy resource-rich Azerbaijan. Even on Darfur, the US and Europe have done little to back up their words of criticism.

Western governments get the worst of both worlds in Africa. They manage to rankle governments they criticise but show little appetite to go beyond rhetoric. No wonder China is gaining in the battle for the continent's hearts and minds.