After nearly seven years, the Syrian civil war is finally winding down, and the Middle East’s various powers are looking ahead to what comes next. On November 22, the leaders of Iran, Russia, and Turkey met in the Russian resort town of Sochi to discuss Syria’s future, and on November 28, the latest round of UN-sponsored talks between representatives of Syrian President Bashar al-Assad and the opposition began in Geneva. Another round of talks in Sochi is planned for early next year.

Dmitri Trenin Trenin, director of the Carnegie Moscow Center, has been with the center since its inception. He also chairs the research council and the Foreign and Security Policy Program. More > @DmitriTrenin

Through military intervention and diplomatic maneuvering, Russian President Vladimir Putin has made his country into one of the major players in the Syrian conflict. Russia went into Syria in September 2015 to defeat the Islamic State (ISIS) and to block an attempt at regime change by outside powers such as the United States and Saudi Arabia. More than two years later, Moscow’s military engagement has paid off. Assad’s regime has survived and ISIS has been defeated. The war is still not over, but the focus is increasingly on a future political settlement. Russia will not be able to impose this settlement alone, or even together with its allies, Iran and Turkey. But it will be as involved in the Syrian peace as it was involved in the Syrian war.

A tangled web

Among the issues now at play in Syria, the fate of Assad stands out. During the war, Moscow saw him as someone to be bailed out for the sake of preventing chaos. Now he looks and behaves like a victor, and may be thinking that he does not need the Russians as much as he used to. Assad looks down on the opposition and wants his Baath Party to become dominant again. The Kremlin, however, understands that restoring his control over all of Syria is impossible and even undesirable, since other groups, from the Sunni opposition to the Kurds, adamantly reject this outcome. Assad may stay in power in Damascus, but the country’s political landscape has changed irreversibly. Still, Moscow has to deal with a recalcitrant Assad while taking account of the influence exerted by its other ally, Tehran.

Even without formal federalization, Syria is de facto divided into several enclaves controlled by different forces: the Assad government; anti-Assad opposition groups; pro-Turkish and pro-Iranian militias; and the Kurds. Russia has worked with many players, both on the ground in Syria and across the region, to create several de-escalation zones, where fighting has stopped and the opposition has been allowed to remain in control. Through its efforts in Astana, Geneva, and Sochi, Moscow has sought to build common ground between all of the country’s contending factions, paving the way for some form of a coalition government. Assad is reluctant to agree to genuine power sharing, and Iran has its own reservations. Thus Moscow will have to do a lot of persuading and occasionally pressuring to achieve its preferred outcome. The Russians believe, however, that a communal power-sharing arrangement akin to Lebanon’s could be a recipe for stability.

Russia insists on the territorial unity of Syria. Moscow takes a similar attitude toward Iraq, where it recently refused to support independence for Iraqi Kurdistan. In Syria as in Iraq, however, Russia favors real autonomy for the Kurds. Over many decades, Moscow has had a long-standing relationship with the Kurdish groups in the Middle East, sometimes assisting them politically and militarily. Russia is used to balancing its relations with the Kurds and with their Arab, Turkish, and Iranian neighbors, and is itself home to a small Kurdish diaspora that facilitates Russian-Kurdish contacts and lobbies for Kurdish interests. In the end, however, it is Russia’s national interest in maintaining contacts with all the relevant players that will win out.

Russia, of course, is not the only outside power in Syria. Even as Moscow supported the Assad regime with its air power, Iran and its allied militias were fighting on the ground. After the war, Tehran wants to institutionalize its presence on the ground in Syria, both to influence the future of that country and to maintain a physical link to its main regional ally, Hezbollah.

Russia understands Iran’s interests without sharing them, but it also understands Israel’s, and it seeks to strike a balance between the two. Moscow empathizes with Israel’s security concerns about the presence of armed Shiite groups too close to its border, and hopes to use the Russian diaspora in Israel for economic, financial, and technological benefit. But it cannot ignore Iran, a regional power and a neighbor that also offers opportunities in a number of areas, from arms sales to nuclear energy. Thus in Syria Russia will seek to broker a compromise between Iran and Israel based on the legitimate interests of each. Iranian Shiite allies might stay in Syria, but they will have to keep their distance from Israel.

Russia’s interaction with the United States in Syria is largely focused on military deconfliction, which is aimed at preventing incidents between the two countries’ armed forces. Moscow and Washington have also cooperated on the establishment of de-escalation zones, but the Kremlin’s diplomatic coordination with the United States is much less intense under the administration of President Donald Trump than under his predecessor, Barack Obama. In 2015 and 2016, the Russians still entertained the thought of jointly developing and implementing a diplomatic solution with the Americans. But today, thanks to waning interest in and a lack of engagement from Washington, Moscow has teamed up with the Turks and the Iranians instead.

The long road ahead

Russia realizes that with the war waning and reconstruction looming, others will begin to step forward in Syria, including China, Europe, and Japan. Moscow will seek to partner with them to secure a piece of the lucrative reconstruction effort, which will be financed by international donors. Russia’s main asset is its influence in Damascus, where it remains the prime guarantor of the Assad regime’s security. This influence may wane over time as direct threats to Assad become less relevant. But for now, with the situation in Syria likely to remain precarious for years, Russia is set to be a major player in the country for the foreseeable future.

Moscow, moreover, means to secure its own core interests in Syria, whatever the balance of political power in the country. Among these is a permanent air and naval presence in the country. Under the lease agreements signed in 2015 and 2016 with Damascus, both the Khmeimim air force base and the Tartus naval facility, which is being upgraded to a regular naval base, will stay in place for decades after the end of the war. The Syrian armed forces will continue to rely on Russian weapons and equipment, and Russian military specialists will continue to advise and train their Syrian colleagues. This will seal Syria’s role as Russia’s main geopolitical and military foothold in the Middle East.

Bringing peace to Syria will be no less difficult than winning a war there. Russia faces another uphill task, one where its assets are less compelling, and where its competitors have more resources, and its situational allies—in Damascus, Tehran, and Ankara—will seek to promote their own agendas, which are sometimes at odds with Moscow’s. Succeeding on the diplomatic front will be even harder than winning on the battlefield.

This op-ed was originally published in Foreign Affairs