Kyiv and Moscow have struck a deal aimed at averting a global food crisis, agreeing a “de facto ceasefire” on cargo ships that will collect millions of tonnes of stranded grain from Ukrainian ports.

At a signing ceremony on Friday in Istanbul, UN secretary-general Ant6nio Guterres hailed it as a “beacon of hope on the Black Sea”.

But with fighting continuing in Ukraine and deep mistrust between the two sides, diplomats warned that upholding the deal would present huge challenges

Guterres said the agreement would “bring relief for developing countries on the edge of bankruptcy and the most vulnerable people on the edge of famine” by helping to stabilise global food prices.

Turkey’s president Recep Tayyip Erdogan, who played a central role in negotiating the deal and whose military will help monitor Ukrainian ports, said his country was “proud to be instrumental in an initiative that will play a major role in solving the global food crisis”.

Under the deal, which aims to restore grain shipments to prewar levels in the coming weeks, Ukraine and Russia have agreed not to attack merchant vessels, civilian vessels or port facilities covered by the agreement, according to a senior UN official.

It represented a “de facto ceasefire”, the official said, but added: “It doesn’t mean to say that parts of those ports which are not engaged in this mission are