The Ukraine Black Sea grain deal has been extended for two more months, in what UN Secretary-General Antonio Guterres hailed as "good news for the world," a day before Russia could have quit the pact over obstacles to its grain and fertiliser exports.
Turkish President Tayyip Erdogan announced the extension in a televised speech and it was later confirmed by Russia, Ukraine and the UN.
The flow of ships through the corridor had been grinding to a halt during the last few days with the deal set to expire on Thursday.
"The continuation is good news for the world," the UN's Guterres told reporters on Wednesday.
The United Nations and Turkey brokered the Black Sea deal for an initial 120 days in July last year to help tackle a global food crisis that has been aggravated by Moscow's invasion of Ukraine, one of the world's leading grain exporters.
Moscow had initially appeared unwilling to extend the pact unless a list of demands regarding its own agricultural exports was met.
"This is a chance to help ensure global food security, not in words, but in deeds. First and foremost, to help the countries most in need," Russia's foreign ministry said, confirming the extension.
"Our principled assessment of the Istanbul agreements of July 22, 2022, has not changed and the distortions in their implementation should be corrected as soon as possible."
While Russian exports of food and fertiliser are not subject to Western sanctions imposed following the February 2022 invasion of Ukraine, Moscow says restrictions on payments, logistics and insurance have amounted to a barrier to shipments.
Russia's UN ambassador, Vassily Nebenzia, said the deal was extended because "we still do not lose hope that the problems that we are raising will be sorted out."
UN chief Guterres said outstanding issues remain but that representatives of Russia, Ukraine, Turkey and the United Nations would keep discussing them.
"Looking ahead, we hope that exports of food and fertilizers, including ammonia, from the Russian Federation and Ukraine will be able to reach global supply chains safely and predictably," Guterres said.
The United States has rejected Russia's complaints. US Ambassador to the UN Linda Thomas-Greenfield said last week: "It is exporting grain and fertilizer at the same levels, if not higher, than before the full-scale invasion."