WASHINGTON (AP) — The United States and Russia are nearing an agreement on Syria for how they hope to resolve the Arab country’s civil war once the Islamic State group is defeated, officials said Thursday.

If clinched, the deal was expected to be announced by President Donald Trump and Russian President Vladimir Putin in Vietnam on Friday, four U.S. officials said. The United States has been reluctant to schedule a formal meeting for the leaders unless they have a substantive agreement to announce.

But White House press secretary Sarah Huckabee Sanders said Friday that they won’t hold a formal meeting due to scheduling conflicts on “both sides.” Still, Sanders said it was possible Trump and Putin could have a less formal encounter while in Vietnam.

The potential understanding comes as an array of forces are near a final defeat of IS, the extremist group that once controlled vast stretches of both Iraq and Syria. Fighting the group is no longer top priority, shifting the focus back to Syria’s intractable conflict between President Bashar Assad’s government and rebels — and to concerns that foreign powers such as Iran will now dominate the country’s future.

The U.S.-Russian agreement being discussed would focus on three elements, officials said: “deconfliction” between the U.S. and Russian militaries, reducing violence in the civil war and reinvigorating U.N.-led peace talks. The officials weren’t authorized to discuss the deliberations and requested anonymity.

The U.S. and Russian militaries have maintained a “deconfliction” hotline for years to avoid unintended collisions and even potential confrontations as they each operate in Syria’s crowded skies. A heavy air campaign by Russia has been credited with shoring up the position of Assad, a close ally of Moscow.

With IS nearing defeat, the U.S. and Russia are losing their common enemy in Syria and will remain in a proxy battle in which Russia backs Assad and the U.S. lends at least rhetorical support to armed opposition groups fighting the government. That has increased the need for close communication between the two powers about where their forces are operating at any given time, officials said.

The agreement also seeks to build on progress in establishing “de-escalation zones” in Syria that have calmed some parts of the country. In July, when Trump held his first meeting with Putin in Germany, the U.S. and Russia announced a deal that included Jordan and established a cease-fire in southwest Syria. The United States has said that cease-fire has largely held and could be replicated elsewhere in the country.

A key U.S. concern, shared by close ally Israel, is the presence of Iranian-backed militias in Syria that have exploited the vacuum of power. The United States and Israel have been seeking ways to prevent forces loyal to Iran — Israel’s archenemy — from establishing a permanent presence. One idea hinges on a “buffer zone” along Israel’s border with Syria.

A third element of the deal would reaffirm support for the United Nations effort being run out of Geneva to seek a political transition in Syria and resolve the civil war. The United States and Russia have been at odds for years over whether Assad could be allowed to remain in power in a future Syrian government.

The U.N. talks, which have come in fits and starts without yielding significant progress, aren’t the only discussions about Syria’s future. Russia, Turkey and Iran have been brokering their own process in Astana, Kazakhstan. The U.S. views those talks warily because of Iran’s involvement, though they’ve led to local cease-fire deals that have reduced violence, too.

“We believe that the Geneva process is the right way to go,” State Department spokeswoman Heather Nauert said Thursday. “Unfortunately, it is a long way off, but we’re getting a little bit closer.”

The U.S.-Russia deal may also seek to expand the mandate of a joint “monitoring center” established this year in Amman, Jordan, to watch for cease-fire violations and other developments on the ground. It has focused on southwest Syria, where the cease-fire is in place, but could be used to monitor broader stretches of the country.

Although Moscow has sought a formal meeting between Trump and Putin while both are in Vietnam this week, the U.S. hasn’t committed to such a meeting. Washington’s concern is that it would not serve U.S. interests unless there’s progress between the countries to announce — on Syria or something else. Putin’s aides have said a meeting will likely occur Friday and that the time, place and format are being worked out between the governments.

“We have been in contact with them, and the view has been if the two leaders are going to meet, is there something sufficiently substantive to talk about that would warrant a formal meeting?” Secretary of State Rex Tillerson said Thursday in Beijing.