By Laura Trevelyan
BBC News, Liberia
Mr Bush visited five African countries during his tour
For a president whose foreign policy has been dominated by Iraq, this visit was a chance for George W Bush to show the world what he calls his mission of mercy - trying to rid Africa of HIV/Aids and Malaria.
There were strategic considerations too - showing China it is not the only power that can sign investment deals with African nations, and cementing friendly relations with West African countries.
West Africa is expected to produce a quarter of America's oil by 2015.
George Bush says moral and national security considerations go together - by ending hopelessness, a moral imperative for a wealthy nation, so the conditions which breed extremism can be eradicated, thus making America safer.
Yet this visit was complicated by the unresolved question of where the planned US military command for Africa, Africom, would be located, and what exactly it is for.
To many Africans, it sounded like a plan for American military expansion into their territory to safeguard US interests.
The president used his visit to Tanzania to showcase the work America is funding to combat HIV/AIDS.
The US has spent $15bn (£7.7bn) over five years in 15 countries, most of them in Africa, buying life-saving drugs.
But the "ABC" focus of the policy - which stands for Abstinence, Be faithful, and use a Condom - has made it unpopular with Democrats in the US congress.
Encouraging people not to have sex as a way of preventing the spread of Aids is unrealistic, say many Democrats, who are threatening not to authorise the president's $30bn programme to combat Aids over the next five years.
So Mr Bush used this visit to do some long-distance lobbying.
He was aided by the Tanzanian President Jakaya Kikwete, who warned that if Pepfar, the presidential programme for fighting Aids, was not renewed, there would be more orphans in his country, and it would be a recipe for disaster.
But the president was challenged by a Ghanaian journalist, who asked how abstinence can work when people have multiple sexual partners.
Ghana is seen as a success story among African countries
This visit was also about highlighting what the White House regards as African success stories, like Ghana and Tanzania, and the need to support fragile countries emerging from conflicts - Rwanda and Liberia.
But there was no escaping the continent's ongoing troubles.
The tribal violence which has riven Kenya left the White House fending off questions about the president's record as a peacekeeper in Africa.
He despatched Condoleezza Rice, his secretary of state, to Nairobi on Monday, to back up the mediation efforts of the former UN Secretary General Kofi Annan.
Mr Bush visited Rwanda, to highlight how the nation is recovering from the 1994 genocide which shocked the world, and to underscore the US efforts to help end the conflict in Sudan's western region of Darfur.
The US has called what is happening in Darfur "genocide", and Mr Bush admitted that his decision not to send US troops there meant he had to live with the UN leading the peacekeeping efforts - slow, and bureaucratic, he observed critically.
By committing $100m to help train and equip African peacekeepers bound for the joint UN/African Union peacekeeping force in Darfur, he hopes to speed up the deployment.
The Sudanese government has objected to the use of non-African troops in the force, yet not all the African peacekeepers had the right equipment - hence the US move.
PRESIDENT BUSH'S ITINERARY
Benin - Cotonou: arrival ceremony, meets president
Tanzania - Dar-es-Salaam: meets president, tours hospital; Arusha: tours hospital, textile mill and girls' school
Rwanda - Kigali: meets president, visits genocide memorial
Ghana - Accra: meets president, state dinner
Liberia - Monrovia: meets president, visits university
The lukewarm response in Africa to Mr Bush's idea of a US military command headquarters in Africa, called Africom, was evident on this visit.
It has been seen as a fig leaf for US troops in Africa, which could be poised to defend strategic interests like oil in, for example, Nigeria.
In Ghana, the US president tackled the issue even before he was asked about it, saying there were rumours that he was coming here to build military bases - this he described as "baloney".
White House officials say Africom is about training African peacekeepers, and co-ordinating US efforts to help the continent.
But many African nations, from South Africa to Ghana, see it as a threat to their sovereignty.
The US support for Ethiopia's invasion of Somalia to put down the Islamic opposition is seen as the kind of mission which could be launched from Africom.
So far only Liberia, Washington's staunchest ally among the 53 African nations, has offered to host Africom.
China is busy building bridges and investing in infrastructure across the continent, in return for oil and minerals to fuel its rapidly expanding economy.
By coming here and showing how the US is spending money in Africa too, Mr Bush is signalling to China that America is a player here as well.
He played down the idea of China as a rival, saying there was room for both countries here. But President John Kufour of Ghana told reporters China is very competitive if Africa wants to buy something, coming to the continent not as a colonial power but as a guest.