Africa has joined India and China as the third region of the world to reach a population of 1 billion people, and it is expected to double its numbers by 2050, the UN says. By then, there will be three times as many people living in Africa's cities, and the continent that had fewer than 500,000 urban dwellers in 1950 may have 1.3 billion.

The breakneck transformation of a rural population into a predominantly urban one is neither good nor bad on its own, says UN-Habitat, the Nairobi-based agency that monitors the world's built environment. But in a report it implored African countries to plan their cities better, to avoid mega-slums and vast areas of deprivation developing across the continent. "The pattern is ... oceans of poverty containing islands of wealth. Conditions in African cities are now the most unequal in the world. They are already inundated with slums and a tripling of urban populations could spell disaster, unless urgent action is initiated today. This situation threatens stability and also entire nations," it said.

Cairo is now Africa's largest urban area, with 11 million people, but the UN said that by 2015 it will have been overtaken by Lagos, with around 12.4 million inhabitants. By 2020 Kinshasa is expected to be the continent's second largest city and Luanda the fourth largest, projected to grow to more than 8 million by 2040.

The speed of growth of some cities "defies belief", said the report. Africa is expected to grow by more than 500 million people in the next 17 years, and a further 500 million by 2050. By then more than 60% of its population will live in cities. The population of Ouagadougou, the capital of Burkina Faso, is expected to soar by more than 80%, from 1.9 million in 2010 to 3.4 million in 2020. The populations of nearly all sub-Saharan cities with more than a million people are expected to expand by an average of 32% in the next 10 years.

"Kinshasa is the fastest-growing city in absolute terms, with 4 million extra people expected, a 46% increase for its 2010 population of 8.7 million. Lagos is the second fastest, with a projected 3.5 million extra people, a 33.8% increase. Abuja, Bamako, Luanda, Lubumbashi and Nairobi are all expected to grow by between 47% and 50% in the next decade, while Dar es Salaam, Kampala, Mbuji-Mayi and Niamey are projected to grow between 50% and 57% ."

The report said providing food and water for the billion extra people on the continent by 2050 will be a huge problem, especially because Africa expects to be hit hard by climate change.

The UN urged governments to strike harder bargains with foreign countries eager to buy up land and water. "Governments should heed the warning bells of 2008 and seriously consider the potential effects of future urban food and water shortages. Significant amounts of African land and water resources are being purchased by foreign governments and foreign food processing corporations. Some even bring farm workers into Africa. Governments must bargain harder for better deals, which contribute to Africa's food and water security."

The authors suggested governments move much of their administrative business out of the capital cities. "They should consider relocating to their secondary cities all government departments and agencies that have no overriding reason to be located in the capital. Relocation would spread economic activity, relieve congestion and the pressures on urban land."

The report found many countries struggling to reverse the tide of slums. Egypt, Libya, Morocco have nearly halved their total number of urban slum dwellers, and Tunisia has eradicated them completely. Ghana, Senegal and Uganda have managed to reduce urban slum populations by more than 20%. More than 75% of Nigeria's population lived in slums in 1990, but that is now 61.9%. In South Africa, slum numbers dropped from 46.2% to 28.7% of the population between 1990 and 2010.

However, numbers of people living in slum conditions have grown in many cases because of the population increases. "As the fastest urbanising continent in the world, Africa is not only confronted with the challenge of improving the lives of slum dwellers but also the challenge of preventing the formation of new slums," said Joan Clos, executive director of UN-Habitat. "This will take considerable political will and financial resources. Most of all, it will require a commitment to strategic urban planning so that the needs of the poor will be met."