The message President Barack Obama carried to Africa on his week-long, three-nation tour was “trade, not aid.” That echoes what Africans are hearing these days from China and Europe.

The United States has been a little late getting on that bandwagon. But the president’s trip was a worthy catch-up effort.

The economies of African nations, are now among the world’s fastest growing, averaging well over 5 percent a year. This trend has not been lost on the world’s economic powers.

President Obama’s last stop, after Senegal and South Africa, was in Tanzania, where China’s new president, Xi Jinping, visited in March — his first foreign visit after taking office. The New York Times reports that total trade between China and Tanzania was $2.47 billion last year, roughly seven times more than the $360.2 million between Tanzania and the United States.

Though U.S. trade with Africa has more than doubled since 2003, China’s has grown much faster, and it is now Africa’s top trading partner. That partnership is a dividend from decades of patient Chinese aid projects that focused on highly visible buildings — concert halls and the like. Those projects aimed at building political capital in Africa.

In contrast, U.S. aid to Africa has been mostly channeled through international institutions that have poured hundreds of billions into schools, health programs and roads. But those initiatives have helped boost African economies.

One outstanding exception to the American practice of funneling aid to Africa through the World Bank and International Monetary Fund is the ongoing funding, started by President George W. Bush, to fight HIV/AIDS on that continent.

Though President Obama has reduced funds for the program, he has preserved much of the Bush health initiative — and his predecessor’s emphasis on using aid to reward nations that demonstrate improvements in democracy, government honesty, transparency and efficiency.

It also was gracious of President Obama to include President and Mrs. Laura Bush in a ceremony to honor those who lost their lives in a 1998 al-Qaida attack on the U.S. Embassy in Tanzania’s capital Dar es Salaam. By coincidence, the Bushes were there to chair a conference on women’s issues supported by their foundation.

But President Obama’s trip was not trouble-free. His security policies in office, including the use of drones, drew predictable protests from the left. South African police used rubber bullets to subdue students demonstrating against him.

President Obama’s visit to South Africa also was overshadowed by the understandable focus on the declining health of Nelson Mandela, who remains an international symbol of racial conciliation due to his long, brave and ultimately successful struggle against apartheid.

But on President Obama’s third stop, in Tanzania, he was able to strongly convey his message that America wants to participate in, and help, Africa’s economic growth.

And that should be a continuing goal for this president — and his successors.