Addis Ababa - Barack Obama on Tuesday condemned African leaders who refuse to give up power and urged the continent to end "the cancer of corruption", in the first ever address to the African Union by a US president.
But Obama also said the world needed to change its approach to Africa by boosting fair trade and not just aid, vowing that the United States stood with the region to defeat terrorism and end conflict.
Also read: Obama to be first US president to address AU
The speech marked the end of a short tour that has seen Obama visit Kenya, his father's birthplace, and Ethiopia. Both are key security allies in the fight against Somalia's Al-Qaeda-affiliated Shebab militants, but they were also taken up on concerns over democracy, human rights and graft.
"Africa's democratic progress is also at risk when leaders refuse to step aside when their terms end," Obama said, drawing huge applause and cheers from some sections of the audience in the AU's Nelson Mandela hall.
"No one should be president for life," he said.
"Now let me be honest with you: I do not understand this. I am in my second term. I love my work, but under our constitution, I cannot run again. I actually think I'm a pretty good president, I think if I ran again I could win, but I can't," he explained.
"And, I'll be honest with you, I'm looking forward to life after being president. I won't have such a big security detail all the time, it means I can take a walk, it means I can spend time with my family.
"The point is I don't understand why people want to stay so long. Especially when they've got a lot of money," he said, drawing a huge cheer.
"Nothing will unlock Africa's economic potential more than ending the cancer of corruption," Obama said, also speaking at length of the need for growth to be unlocked by ending discrimination and sexual violence against women and girls.
Obama singled out Burundi's President Pierre Nkurunziza, whose successful bid for a third term provoked weeks of unrest in the small central African nation, as an example of the dangers of trying to stay put and risking "instability and strife".
Dig at China
At the same time, Obama said the world needed to "recognise Africa's extraordinary progress".
"A half century into this independence era, it is long past time to put aside old stereotypes of an Africa forever mired in poverty and conflict," the president said.
Obama said the United States was a trusted partner of the continent, and took a veiled swipe at resource-hungry China, which has massively stepped up its presence on the continent, symbolised by the Chinese-built AU headquarters where he gave the speech.
"Economic relationships cannot simply be about other countries building infrastructure with foreign labour, or extracting Africa's natural resources," Obama said.
"Real economic partnerships have to be a good deal for Africa. They have to create jobs and capacity for Africans. That's the kind of partnership America offers."
Obama said the United States also stood with Africa to defeat terrorism and end conflict, warning that the continent's progress will "depend on security and peace".
"As Africa stands against terror and conflict, I want you to know the United States stands with you," he said, highlighting threats ranging from Somalia's Shebab, Boko Haram in Nigeria, insurgents in Mali and Tunisia, and the Uganda-led Lord's Resistance Army rebels in central Africa.
Obama said the United States was backing AU military efforts and saluted the "brave African peacekeepers" battling militants.
"Many of these groups claim the banner of religion, but hundreds of millions of African Muslims know that Islam means peace. We must call groups like Al-Qaeda, ISIL (Islamic State), Al-Shebab and Boko Haram, we must call them what they are murderers."