Ukraine, Russia, and Turkey, and the United Nations will sign a deal on July 22 in Istanbul to resume Ukraine’s Black Sea grain exports, Turkish President Recep Tayyip Erdogan’s office said.

Negotiations between the four parties in Istanbul last week reportedly were close to a deal on a UN-led plan to allow shipments of grain to begin moving through the ports.

Erdogan’s office on July 21 said a general agreement on the resumption of grain exports was reached during the talks and would now be put in writing by the parties.

Details of the agreement were not immediately known.

The U.S. State Department welcomed Turkey’s announcement but said it would focus on holding Russia accountable for implementing the deal.

The Ukrainian Foreign Ministry said a UN-led round of talks would take place in Turkey on July 22, but a ministry spokesman did not confirm that a document would be signed.

“In summary, a document may be signed which will bind the sides to [ensure] safe functioning of export routes in the Black Sea,” Oleg Nikolenko told Reuters.

Nikolenko said the Ukrainian delegation at the talks would only support decisions guaranteeing the safety of Ukraine’s southern regions, “strong positions” of Ukraine’s armed forces in the Black Sea, and safe exports of Ukrainian agricultural products.

UN Secretary-General Antonio Guterres was on his way to Istanbul on July 21, but a UN spokesman said an agreement on a deal had not yet been fully negotiated.

“What we’re trying to do is have an agreement that would allow for Ukrainian and Russian food and fertilizer to reach global markets,” UN spokesman Farhan Haq said in New York said.

The UN has pointed out how serious the food crisis around the world is, Haq said, and the grain-export issue is a large component of it. Hundreds of thousands, potentially even millions of people will be spared having food priced out of their reach if the problem can be resolved, he added.

Russia and Ukraine are major global wheat suppliers, but Ukraine’s Black Sea ports have been blocked because of the war. Russia has captured some of the ports and bombarded others, while Ukraine has mined the approaches to some ports to protect them from a Russian amphibious assault.

Diplomats have said that the plan being discussed includes having Ukrainian vessels guide grain ships in and out of port waters that its forces have mined, Russia agreeing to a truce while shipments move, and Turkey inspecting ships with support from the UN to allay Russian fears of weapons smuggling.

Ukraine could potentially quickly restart exports, Ukraine’s Deputy Agriculture Minister Taras Vysotskiy said earlier on July 21.

“The majority of the infrastructure of the ports of wider Odesa — there are three of them — remains, so it is a question of several weeks in the event there are proper security guarantees,” he told Ukrainian television.

Moscow has denied responsibility for worsening the food crisis, instead blaming Western sanctions for slowing its own food and fertilizer exports and Ukraine for mining its Black Sea ports.

A day after the Istanbul talks last week, the United States sought to facilitate Russian food and fertilizer exports by reassuring banks, shipping, and insurance companies that such transactions would not breach sanctions on Moscow over its invasion of Ukraine.