Africa's cities to triple in size
The number of people living in African cities will triple over the next 40 years and by 2050 60% of Africans will be city dwellers, a UN report has said.
In five years Lagos in Nigeria is set to overtake the Egyptian capital Cairo as Africa's biggest city.
UN-Habitat's Joan Clos said Africa needed to invest urgently in housing.
He told the BBC that sub-Saharan Africa could learn from North Africa as Egypt, Libya, Morocco and Tunisia had almost halved slum areas in the past 20 years.
Some 199.5 million people in sub-Saharan Africa live in slums, the highest number in the world, the UN said earlier this year.
According to UN-Habitat's State of African Cities 2010 report, urbanisation is happening faster in Africa than anywhere else in the world.
By 2030 the continent will no longer be predominately rural, it says.
Mr Clos, UN-Habitat's executive director, said that cities were attractive places for those wanting to relocate.
"People are looking for a better future and they think the city can offer that," he told the BBC's Focus on Africa programme.
Agricultural reform and poverty in rural areas were another reason for the trend, he said.
Many African cities already face major problems of overcrowding, irregular supplies of water and power and poor transport infrastructure.
But urbanisation often led to improved living standards, if action was taken to provide adequate housing, infrastructure and services, Mr Clos said.
In 2015 it is estimated Lagos will have 12.4 million inhabitants.
The UN also forecasts that the population of Kinshasa, the capital of the Democratic Republic of Congo, will increase by 46% over the next 10 years to become the fast-growing city.
By 2050, Africa's urban population is expected to reach 1.23 billion.
The report warns that climate change is causing a serious problem for some cities.
With many of Africa's cities built by the sea, millions of people risk losing their homes in the coming decades because of coastal flooding.
It says the West African coastline is retreating by between 20m and 30m every year.