Ukraine and Russia signed a breakthrough agreement on Friday, designed to help relieve a global food crisis caused by blocked Black Sea grain exports.
The ceremony marks the first major deal between the warring sides since Russia's February invasion of its neighbour, and comes as global food prices have soared, and people in some of the world's poorest countries are facing starvation.
Kyiv and Moscow signed two identical but separate documents at the request of Ukraine, which refused to initial any document with Russia.
Under the agreement, "safe corridors" will allow the movement of cargo ships in the Black Sea, which "both sides have committed not to attack," said a UN official who requested anonymity.
Negotiators abandoned the idea of clearing the Black Sea of mines -- mainly laid by the Ukrainians to protect their coastline. "Clearing mines would have taken too long," the UN said, adding that "Ukrainian pilots" would clear the way for cargo ships within Kyiv's territorial waters.
'An agreement for the world'
The deal has been brokered by Turkey and the United Nations. President Recep Tayyip Erdoğan was joined by UN Secretary-General Antonio Guterres for a signing ceremony in Istanbul's lavish Dolmabahçe Palace on Friday afternoon.
"We are proud to be instrumental in an initiative that will play a major role in solving global food crisis that has been on the agenda for a long time," Erdoğan said while announcing the signing of the deal Guterres dubbed "an agreement for the world".
The UN chief applauded the two sides for "overcoming their differences to make way for an initiative that serves all" and pleaded that the agreement "must be fully implemented".
The first direct talks between the warring sides' military delegations since March -- attended in Istanbul last week by Turkish and UN officials -- came up with an initial draft for resolving the impasse.
But Russian President Vladimir Putin threatened to derail the talks by warning on Tuesday that he expected any agreement also to address his own country's blocked grain exports. Foreign Minister Sergey Lavrov was also reserved about any potential deal being reached, claiming that the authorities in Kyiv are blocking the talks.
In the run-up to the Friday ceremony, Ukrainian authorities stated they would not sign any document together with Russia, agreeing to initial an agreement together with Turkey and the UN.
The five-month war is being fought across one of Europe's most fertile regions by two of the world's biggest producers of grain.
Almost all of the grain is usually shipped out of the region across the Black Sea.
Exports to take place from three Black Sea ports
Turkish Foreign Minister Mevlüt Çavuşoğlu on Thursday acknowledged Putin's concerns.
"When we resolve this issue, not only will the export path for grain and sunflower oil from Ukraine be opened, but also for products from Russia," he said.
When we resolve this issue, not only will the export path for grain and sunflower oil from Ukraine be opened, but also for products from Russia."
"Even if these Russian products are not affected by sanctions, there are blockages concerning maritime transport, insurance and the banking system," Çavuşoğlu added. "The United States and the EU have given promises to lift these."
NATO member Turkey has enjoyed good working relations with both Moscow and Kyiv throughout the conflict.
A member of Kyiv's delegation for the negotiations said the shipments could resume from three ports under full Ukrainian control.
"Exports would take place through three ports: Odesa, Pivdennyi and Chornomorsk. But in the future we hope we could expand them," Ukrainian lawmaker Rustem Umerov told reporters.
He added that the safety of the shipments would be overseen by a UN monitoring group based in Istanbul, which was confirmed by Guterres after the signing of the agreement.