SOWETO, South Africa (AFP) - US President Barack Obama told Africa's youth on Saturday that the future of the continent was in their hands and urged them to use Nelson Mandela as a model for political leadership.
Obama got a rowdy welcome as he used a town hall style meeting in South Africa to announce a new fellowship that will initially take 500 young African leaders to the United States every year for academic and leadership training.
As Obama spoke at a university in the sprawling township of Soweto where opposition to apartheid sprung into life, police nearby fired stun grenades to disperse hundreds of people critical of his anti-terror policies.
The US leader, on the second leg of an African tour, spoke at a University of Johannesburg not far from the simple homes in Soweto where Mandela, now 94 and in a critical condition in hospital, spent several years of his life.
"The future of this continent is in your hands," Obama said.
He urged young people in Soweto and those watching the town hall meeting in Kenya, Nigeria and Uganda to take inspiration from Mandela's refusal to be cowed by 27 years in jail.
"Think about 27 years in prison. Think about hardships and the struggles and being away from family and friends," Obama said.
"There were dark moments that tested his faith in humanity, but he refused to give up.
"In your lives there will be times to test your faith." Obama was greeted with wild enthusiasm by the crowd in Soweto, who sang South African protest songs before he arrived and chanted his "Yes We Can" campaign slogan when he took the stage.
However, protesters set fire to US flags and portraits of Obama and at least three bangs from stun grenades were heard as armed police tried to move demonstrators away from the university.
"The message is clear. We want him to honour the promises he made when he became president, including things like the closing of Guantanamo Bay," 30-year-old Firoz Osman said.