By Huseyin Hayatsever and Michelle Nichols
ANKARA/UNITED NATIONS (Reuters) -The Ukraine Black Sea grain deal has been extended for two more months, in what U.N. 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 United Nations.
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 U.N.'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. U.S. Ambassador to the U.N. 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."
EXTENSION WELCOMED BY UKRAINE
Ukraine also welcomed the extension but a senior official said Russia must not be allowed to sabotage the agreement and must stop using food "as a weapon and blackmail."
"We welcome the continuation of the Initiative, but emphasise that it must work effectively," Deputy Prime Minister Oleksandr Kubrakov said on Facebook.
The extension helped to drive down grain prices on Wednesday with Chicago wheat futures and corn futures both falling by around 4%.
Earlier on Wednesday, the last remaining ship registered to travel through the corridor had left a Ukrainian port.
U.N. data showed that the DSM Capella had left the Ukrainian port of Chornomorsk carrying 30,000 tonnes of corn and was on its way to Turkey.
Officials from Russia, Ukraine, Turkey and the U.N. make up a Joint Coordination Centre (JCC) in Istanbul, which implements the Black Sea export deal. They authorise and inspect ships. No new vessels have been authorised by the JCC since May 4.
Authorised ships are inspected by JCC officials near Turkey before travelling to a Ukrainian Black Sea port via a maritime humanitarian corridor to collect their cargo and return to Turkish waters for a final inspection.
In an excerpt of a letter seen by Reuters last month, Russia told its JCC counterparts that it would not approve any new vessels to take part in the Black Sea deal unless the transits would be done by May 18 - "the expected date of ... closure."
It said this was "to avoid commercial losses and prevent possible safety risks" after May 18.
Some 30.3 million tonnes of grain and foodstuffs has been exported from Ukraine under the Black Sea deal, including 625,000 tonnes in World Food Programme vessels for aid operations in Afghanistan, Ethiopia, Kenya, Somalia and Yemen.
(Reporting by Huseyin Hayatsever in Ankara and Michelle Nichols at United NationsAdditional reporting by Orhan Coskun, Ali Kucukgocmen, David Ljunggren and Pavel PolityukWriting by Michelle Nichols, Nigel Hunt and Gareth JonesEditing by Alison Williams and Matthew Lewis)