Activists sharply criticised a pledge by the Group of Seven rich countries on Tuesday to commit $4.5 billion to fight global hunger, saying the sum fell short of what was needed with millions of people on the brink of starvation.

The worst drought in decades in parts of Africa and soaring food prices, driven higher by Russia's invasion of Ukraine, have sparked repeated warnings about threats to food security of the world's poorest and possible famines.

At the end of a three-day G7 summit in the Bavarian Alps, the leaders committed the $4.5 billion to protect the most vulnerable from hunger and malnutrition, saying that amounted to $14 billion of assistance committed this year.

They called on those with stockpiles to make food available and said they were working on ways to get grain out of Ukraine, after a Russian blockade of Black Sea ports pushed trade to slower land routes.

They also agreed to step up their efforts to help farmers to keep working in Ukraine, one of the world's largest grain producers, and address fertiliser shortages.

But activists said the pledges fell short.

"Faced with the worst hunger crisis in a generation, the G7 have simply failed to take the action that is needed. Many millions will face terrible hunger and starvation as a result," Max Lawson, head of inequality policy at Oxfam.

"Instead of doing what is needed, the G7 are leaving millions to starve and cooking the planet."

German Chancellor Olaf Scholz, who hosted the summit, defended the money committed when questioned on Tuesday, adding "we won't stop doing what is necessary" to fight hunger.

The ONE Campaign said the G7 had failed to show global leadership.

"The G7 are talking about a total of $14 billion to fight the food crisis. But this is nowhere near the $21.5 billion that the World Food Programme needs this year alone," said Stephan Exo-Kreischer, director of ONE Germany.

It added that only $4.5 billion of the money was new and that the G7 had not yet answered how it intended to help break the blockade on the Black Sea hindering Ukrainian exports.

Germany and Britain had pushed fellow G7 members to push temporary waivers on biofuels to combat soaring food prices by increasing supplies of grain and vegetable oil.

But there was no waiver in the final communique, as Berlin had anticipated.

The G7 has stressed the blame for rising food prices lay at Russia's door, which Moscow rejects.

"Russia's war of aggression against Ukraine, including its blocking of export routes for Ukraine?s grain, is dramatically aggravating the hunger crisis," the G7 statement said, adding the group was still committed to lifting 500 million people out of hunger and malnutrition by 2030.

(Editing by Alison Williams)