The government of President Bashar al-Assad is resurgent in Syria, steadily retaking terrain lost to the rebels. This may bring to an end one set of conflicts, but it could spark newer, potentially more dangerous confrontations.

The key to preventing the Syrian civil war from splintering into an even more chaotic and deadly phase will be Russia, whose September 2015 military intervention gave it control of Syrian airspace and placed it politically in the driver’s seat. But the United States, too, could still play an important role in preventing matters from getting worse.

To understand how perilous the situation in Syria is, look at the map: In the northwest, in Idlib Province, a “de-escalation zone” that is monitored by the Turkish Army remains tenuous. The Assad government is keen to drive the Turks out, as well as jihadists and other rebels. In the northeast, the Kurds have established a form of self-government, led by the militia called Y.P.G., an American ally in the fight against Islamic State. But that group is the Syrian affiliate of the P.K.K. in Turkey, and is therefore in the Turkish military’s cross hairs. Further to the east, remnants of the Islamic State still roam the desert near the Iraqi border, pursued by the United States and the Y.P.G. as well as by the Syrian regime, and backed by Iran and associated militias.

The greatest danger lies in the south, along the armistice line that divides Israel and Syria. Recent tit-for-tat attacks between Israel and Iran and its allies have raised the risk of escalation. In February, only a phone call from President Vladimir Putin of Russia to Prime Minister Benjamin Netanyahu of Israel induced Israel to call off further airstrikes against Syrian government and Iranian targets after an Iranian drone invaded Israeli airspace. More recently, Israel piggybacked on international outrage over an apparent regime chemical attack to carry out a second round of strikes, reportedly killing 10 Iranian military personnel and several others at a Syrian airfield. Iran vowed to respond, and is likely to do so at a time of its choosing. This is a game of chicken that could easily spiral out of control.

As Mr. Putin’s intervention in February showed, Russia is ideally placed to prevent an outright war between Israel and Iran across Syria’s smoking remains. Unlike the United States, Moscow has strong working relationships with nearly everyone: Tel Aviv as well as Tehran, Damascus as much as Ankara, and Hezbollah to boot. And Russia has an overriding interest in preventing a war in Syria between Israel and Iran, if only to preserve its own gains, starting with Mr. Assad’s survival.

But is Russia able and ready to play this role? The best way to prevent a confrontation between Iran (and Hezbollah) and Israel would be to establish a communications channel for all parties directly with the Kremlin and Russian military. Mr. Putin, though, might not have much interest in this kind of proactive measure when he can currently magnify his personal role by simply picking up the phone to defuse a crisis.

It’s also unclear if Washington and its European allies would support a Russian mediation effort. They should. Even Israel is looking to Russia to rein in Iran and Hezbollah in Syria, or at least prevent them from moving offensive forces toward the Golan Heights. The United States, which has stepped back from active diplomatic involvement in Syria’s war, should therefore accept, and indeed encourage, Russian mediation.

In the past three years, the United States has been reduced to playing little more than a spoiler role in Syria. This was highlighted in April by the airstrikes it launched jointly with Britain and France in response to an apparent regime chemical attack. While measured and targeted, these strikes appeared to accomplish little; time will tell if they will deter the Syrian government from using chemical weapons.

They were only symbolic by choice, however. Washington could have followed them with specific demands backed by the threat of more impactful strikes. The United States, with its overwhelming military power, still has the ability to shape the battlefield in Syria but it would need to combine the threat of the use of force with diplomacy.

Relations between Russia and the United States may have taken a turn for the worse, but neither country seems to want a volatile region to spin further out of control, with unpredictable consequences. This offers common ground, however thin, for cooperation on at least two fronts.

One is de-escalating the Syrian war. This may no longer lead to a political settlement involving the opposition, given the rebels’ waning fortunes, but Russia would need a degree of stability to be able to declare victory and reduce its military footprint. This is why Moscow supplanted the moribund United Nations-led Geneva peace process with talks it initiated early last year in Astana, Kazakhstan, with Iran and Turkey. Russia chose to foster this process because it realized that Mr. Assad, weakened by years of fighting, cannot win a battlefield victory or hope to survive without continuing military assistance, much less govern a country he destroyed.

Mr. Assad’s profound weakness and Russia’s need for stability may provide leverage to the United States and Europe, whether through stabilization and reconstruction funds, which Russia and Iran lack, or by playing the spoiler role. An open-ended American military deployment in eastern Syria and its ability to keep large sections of the country beyond Damascus’s control are providing significant leverage. Yet this is a dangerous card to play, as it leaves open the possibility of a superpower confrontation.

A second area of potential cooperation is de-escalating surging tensions between Israel and Iran. Here, the Trump administration could support Russia-led mediation, but this would require not only active engagement with Moscow but also an altogether different approach toward the Syrian government’s other ally: Iran. If the United States pulls out of the nuclear accord, as it appears set to do by the May 12 deadline, it will put itself on a path of military confrontation with Iran.

If, on the other hand, the Trump administration pursues the same approach with Iran as it has with North Korea, and begins to talk seriously with Iranian leaders, it could help defuse tensions in the Middle East. This would not be an easy road to travel for an administration that lacks a strategy and is led by a temperamental president. But the current dangers of escalation make the alternative far, far worse.

Joost Hiltermann (@JoostHiltermann) is the Middle East and North Africa program director for International Crisis Group and the author, most recently, of “A Poisonous Affair: America, Iraq, and the Gassing of Halabja.”

Follow The New York Times Opinion section on Facebook and Twitter (@NYTopinion), and sign up for the Opinion Today newsletter.