• Secretary-General Antonio Guterres said the war had worsened food insecurity in poorer nations due to rising prices.
• The conflict has cut-off supplies from Ukraine's ports, which once exported vast amounts of sunflower oil as well as cereals such as maize and wheat.
Russia's invasion of Ukraine could cause global food shortages in the coming months, the UN has warned.
Secretary-General Antonio Guterres said the war had worsened food insecurity in poorer nations due to rising prices.
The world could face famines that last for years if Ukrainian exports are not restored to pre-war levels, he added.
The conflict has cut-off supplies from Ukraine's ports, which once exported vast amounts of sunflower oil as well as cereals such as maize and wheat.
This has reduced the global supply and caused the price of alternatives to soar. Global food prices are almost 30% higher than the same time last year, according to the UN.
Speaking in New York on Wednesday, Mr Guterres said the conflict "threatens to tip tens of millions of people over the edge into food insecurity followed by malnutrition, mass hunger and famine".
"There is enough food in our world now if we act together. But unless we solve this problem today, we face the spectre of global food shortage in the coming months," he added.
He warned that there was no effective solution to the food crisis without reintegrating Ukraine's food production, as well as the fertiliser produced by Russia and Belarus, into the global market.
Mr Guterres also said he was in "intense contact" with Russia and Ukraine, as well as the US and the EU, in an effort to restore food exports to normal levels.
"The complex security, economic and financial implications require goodwill on all sides," he said.
His comments came on the same day the World Bank announced extra funding worth $12bn (£9.7bn) for projects addressing food insecurity.
The move will bring the total amount available for such projects to more than £30bn over the next 15 months.
Russia and Ukraine produce 30% of the world's wheat supply and - prior to the war - Ukraine was seen as the world's bread basket, exporting 4.5 million tonnes of agricultural produce per month through its ports.
But since Russia launched its invasion in February, exports have collapsed and prices have skyrocketed. They climbed even further after India banned wheat exports on Saturday.
The UN says around 20 million tonnes of grain are currently stuck in Ukraine from the previous harvest which, if released, could ease pressure on global markets.
While the number of people facing food insecurity had been growing even before the invasion, German Foreign Minister Annalena Baerbock, accused Moscow of making a difficult situation even worse on Wednesday.
"Russia has launched a grain war, stoking a global food crisis," Berlin's top diplomat said. "It is doing so at a time when millions are already being threatened by hunger, particularly in the Middle East and Africa."
Meanwhile, US Secretary of State Antony Blinken said the world faced the "greatest global food security crisis of our time" which had been exacerbated by what he called Russian President Vladimir Putin's "war of choice".