RIO DE JANEIRO — In Mozambique, Brazil’s government is opening a plant making antiretroviral drugs to fight the AIDS epidemic. Brazil is lending $150 million to Kenya to build roads and ease congestion in the capital, Nairobi. And in Angola, a rising oil power, a new security agreement seeks to expand the training of Angolan military personnel in Brazil.

Brazil, which has more people of African descent than any other country outside of Africa itself, is assertively raising its profile again on the continent, building on historical ties from the time of the Portuguese empire.

The array of aid projects and loans recently extended to African countries points both to Brazil’s ambitions of projecting greater influence in the developing world and to the expanding business allure of Africa, where some economies are rapidly growing even as parts of the continent still grapple with wars and famine. The charm offensive is paying off in surging trade flows between Brazil and Africa, growing to $27.6 billion in 2011 from $4.3 billion in 2002.

“There’s the growing sense that Africa is Brazil’s frontier,” said Jerry Dávila, a historian at the University of Illinois who has written extensively about Brazil’s inroads across the South Atlantic Ocean. “Brazil is in the privileged position of finally reaching the institutional capacity to do this.”