Millions of tonnes of grain will be shipped from Ukraine's blockaded ports within days after a UN-brokered deal to tackle global food prices, Turkish President Recep Tayyip Erdogan announced on Friday.

Dozens of bulkers that had been trapped during six months of fighting are expected to start leaving blockaded ports under escort in about two weeks, according to media reports citing UN officials.

After months of rising food prices, UN Secretary-General Antonio Guterres said the deal struck between the two warring sides was an "agreement for the world" during a signing ceremony in Istanbul.

He said the deal cleared the way for significant volumes of exports from the three key Ukrainian ports of Odesa, Chernomorsk and Yuzhny. The UN and Turkey will run a joint coordination centre in Istanbul to ensure the inspection and oversight of the passage of cargo ships in and out of Ukrainian ports.

“Today there is a beacon on the Black Sea. A beacon of hope, a beacon of possibility, a beacon of relief in a world that needs it more than ever,” said the UN chief.

But he warned Russia and Ukraine had to spare no effort to make the deal work amid concerns about continued obstacles to export the grain through the mined waters off Ukraine's ports.

The International Chamber of Shipping (ICS) said that 400 bulkers would be needed to bring the estimated 20m tonnes of grain out of the country.

The ICS said 109 vessels had been identified at Ukraine's ports and they included non-bulkers including tankers and tugs. TradeWinds has identified some 50 non-Ukrainian or Russian ships over 10,000-dwt currently stuck in ports.

The ICS's John Stawpert also warned that the 2,000 seafarers on board at the start of the war had been reduced to 450 for safety reasons.

"We would want to see guarantees that the seafarers will be safe when they undertake these passages," he told the BBC. "We have seen casualties of seafarers in this conflict and their safety is crucial if we’re to get this moving quickly."

The accord ended two months of talks that also eases Russian grain and fertiliser shipments.

The breakthrough deal came despite deep suspicions between the two sides.

The Ukrainian foreign ministry said it only backed an agreement that “will guarantee the security of the southern regions of Ukraine, the strong positions of the Ukrainian armed forces in the Black Sea, and the safe export of Ukrainian agricultural products to the world markets.”

Citing diplomats, the BBC said that Russia agreed to a truce while shipments move. Turkey and the UN would inspect ships, to allay Russian fears of weapons smuggling.

The European Union signalled it would would ease its sanctions against key Russian banks as part of diplomatic efforts to restart Ukraine grain shipments from Black Sea ports.

The US State Department said it was vital that Russia now kept to its side of the bargain.

“What we’re focusing on now is holding Russia accountable for implementing this agreement and for enabling Ukrainian grain to get to world markets,” said spokesman Ned Price before the agreement was signed.

Ukraine is among the world's largest grain exporters and their inability to participate in the global market has contributed to the recent rise in grain prices and contributed to worries about a global food shortage.

S&P has doubts

Questions remain about how quickly exports can restart with the Wall Street Journal reporting Ukraine has increased the number of mines near its Black Sea ports to prevent Russian attacks.

In a flash note issued after the agreement was signed, S&P expressed doubts how quickly grain exports will be able to resume.

“We believe it may take a few weeks to months to resolve insurance and safety concerns for the Black Sea routes from major grain ports, including Odessa,“ said Daejin Lee, lead shipping analyst at S&P Global Market Intelligence.

Danube River ports serviced by small domestic vessels will likely remain a safe and attractive option for grain exports in the near term, Lee added.

However, even taking account of new additional capacity of up to 1.5 million tonnes per month from Danube River ports, total grain export capacity will be still between 70% and 80% below the pre-invasion level in terms of combined bulk and general cargo vessel capacity, Lee said.