Secretary-General Antonio Guterres said the war had worsened food insecurity in poorer nations due to rising prices.
Some countries could face long-term famines if Ukraine’s 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 cooking 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 – combined with the effects of climate change and the pandemic – “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 the only effective solution to the crisis was reintegrating Ukraine’s food production, as well as fertiliser produced by both Russia and Belarus, back into the global market.
Read more: BBC