Obama in Africa: 'Let's do business'
US President Barack Obama's tour of Africa ended as it had begun, with a nod to history.
In Senegal last week, Mr Obama had visited Goree Island; until the mid-19th Century it was from there that slaves were shipped across the Atlantic to America, bound in chains.
In Tanzania on Tuesday, the focus was on more recent events.
In a rare joint appearance, President Obama and his predecessor, George W Bush, bowed their heads as a marine laid a wreath at a memorial for the 11 victims who lost their lives in the bombing of the US embassy in Dar es Salaam in 1998.
The brief ceremony was a reminder of the challenge still faced by the US and its allies, 15 years later, from Islamist militants in East Africa.
In Somalia, al-Shabab, a group with links to al-Qaeda, continues to battle the US-funded Somali government and African Union forces.
But the focus of this six-day tour was not on security, nor on the past.
In 2009, during Mr Obama's first term in the White House, China overtook the US as the world's biggest investor in Africa.
So now, as he made his first extended visit to the continent, President Obama's message was in essence: "Let's do business."
The centrepiece of the visit was the announcement of a new initiative, dubbed "Power Africa".
Mr Obama used an address to students at Cape Town University in South Africa on Sunday to pledge $7bn (£4.6bn) of US government money to bring "light where currently there is darkness".
"Access to electricity is fundamental to opportunity in this age," Mr Obama said on Sunday.
"It's the light that children study by, the energy that allows an idea to be transformed into a real business.
"It's the lifeline for families to meet their most basic needs, and it's the connection that's needed to plug Africa into the grid of the global economy.
"You've got to have power."
Two days later, at a power plant in Tanzania, Mr Obama had the opportunity to test an innovative bit of new technology: the "soccet ball".
"It's an airless, energy-generating soccer ball," explained Jessica Matthews, a Nigerian-American inventor, as she gave the BBC a sneak preview before handing her creation over to the US president to kick around.
"As you play with it, it basically harnesses that kinetic energy that's generated during play.
"So then you can use it as a power source to power small appliances like lamps or cellphones."
Ms Matthews plugged a light into the socket in the ball, and it lit up like magic.
But Mr Obama's ambitions go way beyond small appliances.
"This plant represents the public-private partnership we want to replicate across the continent," the president said at the US-owned Ubungo plant on the outskirts of Dar es Salaam.
"This is a win win. It's a win for Africans: Families get to electrify their homes; businesses can run their plants; all this will make economies grow.
"It's a win for the United States because the investments made here, including in cleaner energy, means more exports for the US and more jobs in the US."
This was a tour of emotional moments.
The visit to South Africa was overshadowed by the news of the ailing health of Nelson Mandela, Mr Obama's "personal hero" and the man who, we learned, inspired him to make his first political speech at the age of 19.
One of the most poignant images is surely that of Mr Obama standing alone at the gateway to Goree Island off the coast of Senegal.
He stares out to sea, contemplating presumably the arc of history that saw a black man become president of the United States.
There is no doubting Mr Obama's popularity in Africa.
His personal connection to the continent makes him an automatic hero for many.
But there are plenty here who believe that, in his first term at least, Mr Obama failed to engage with Africa.
This trip may have gone some way to overcome that sense of disappointment.
But when it comes to investment, America's businessman-in-chief is still playing catch-up with China.