German Chancellor Angela Merkel has emphasised that Africa will be a priority when her country takes over the G20’s revolving presidency at the end of 2016.
She was speaking in Ethiopia on the final stage of a tour, which also included Mali and Niger.
Mrs Merkel has made pledges of development as well as military aid on her trip.
She has told Germans it is important to stem migration at its source.
Germany took in more than one million irregular migrants last year - many from war-ravaged Syria, Iraq and Afghanistan, but also many fleeing economic hardship across Africa.
Migration is expected to be a key issue in next year’s federal elections, though Mrs Merkel has not yet declared whether she will seek a fourth term as chancellor.
Ethiopia hosts 700,000 refugees - one of the highest rates in Africa, according to the UN refugee agency.
Some 90% of migrants who reach Libya - a jumping-off point for the perilous sea crossing to Europe - are said to pass through Niger.
And on her visits to Mali and Niger earlier in the week, Mrs Merkel highlighted the deadly desert crossing that African migrants undertake even before reaching the Mediterranean.
What was the point of Mrs Merkel’s trip?
Commentators say this flurry of diplomacy illustrates how deeply the migration crisis is affecting the foreign policy of arguably the European Union’s most powerful nation.
In Mali, Mrs Merkel pledged more support to fight drug- and people-smuggling, as well as the country’s agricultural sector.
She also said Germany would give extra help to stabilise the north, where jihadist groups still operate - Germany already has 550 troops in Mali.
In Niger, Mrs Merkel pledged aid for both development and military equipment. Germany will also build a military base to support the UN mission in neighbouring Mali.
Migration was also on the agenda for talks with Ethiopian Prime Minister Hailemariam Desalegn.
How is the trip viewed at home?
Historically Germany has had a tiny influence on the African continent when compared with France or Britain.
But Mrs Merkel said before her trip that Germans should "take a far greater interest in Africa’s destiny".
"The wellbeing of Africa is in Germany’s interest," she said.
For Merkel biographer Margaret Heckel, this represents a change of strategy for Germany, from compassion to political reality.
"In the past, when Germany gave development aid, it was always depicted as altruistic, now it’s base political tactics," she told the BBC. "She also said it can’t be done in days, months or even years but is something for a generation."
She believes the chancellor will face questions of how successful she can be.
What does it mean for Africa?
At best, the visit shows that Europe’s most influential politician has understood that equitable, economic development would be a game-changer for countries that are losing their youth to emigration, says BBC correspondent Alex Duval Smith.
Mrs Merkel said she would use Germany’s presidency of the G20 in 2017 to encourage the private sector to invest in transport and energy networks and better vocational training in sub-Saharan Africa.
Her €77m (£70m; $85m) pledge over several years to improve training and infrastructure in the arid and impoverished Agadez region of Niger could be seed money for a broader push from the private sector.
On the other hand, Germany’s ambitions could be narrower. The focus on security - including €10m she pledged for communications equipment and vehicles for Niger’s army - could be intended as a strong-arm tactic to close off the desert to migrants.
Mrs Merkel is not just pursuing a "soft" approach by increasing development spending in an attempt to reduce the "push" factors that drive migration.
She is also focusing on security.
So what are the dangers of Mrs Merkel’s approach?
The German leader has indicated she would like to agree deals with African nations along the lines of the EU’s much-criticised arrangement with Turkey, whereby Turkey agrees to take back illegal migrants in exchange for vetted Syrian refugees and other benefits such as visa-free travel.
Have Turkey and the EU struck a dirty deal?
That could see aid tied to countries taking migrants back, but these are countries criticised over failure to respect human rights and the rule of law.
Mrs Merkel’s experience in Ethiopia is a case in point.
While she thanked Prime Minister Hailemariam for hosting hundreds of thousands of migrants from around the region, he requested further "enhancement of investment relations", according to local TV.
But Chancellor Merkel was also compelled to warn authorities against using excessive force against protesters amid the worst unrest since Ethiopia’s government came to power in 1991.