For years, foreign countries have manipulated and fueled the fighting in Syria. But now the key to a deal may lie with the great powers. Last year, Assad’s forces were in retreat and Russian President Vladimir Putin was facing the loss of his Syrian ally. In September, Russia deployed aircraft and other assets to Syria, and launched a sustained bombing campaign that stabilized Assad’s battlefield position. The major payoff for Putin was a story. He could spin a narrative in which he saved Assad and then pivoted to the role of peacemaker. By wielding both the sword and the olive branch, Russia would be an indispensable nation—and end the international shunning triggered by the earlier Russian intervention in Ukraine.

Last December, the UN Security Council endorsed a U.S. and Russia-backed peace plan that envisioned “credible, inclusive and nonsectarian governance” in Syria within six months, followed by “free and fair elections” within 18 months. In February, the Syrian government and several rebel groups (excluding ISIS and the al-Qaeda affiliate Jabhat al-Nusra) agreed to a cessation of hostilities, and tentative peace talks began in Geneva. Despite some violations, the truce has held better than many people expected. In mid-March, U.S. Secretary of State John Kerry claimed that the level of violence “by all accounts has been reduced by 80 to 90 percent, which is very, very significant.”

Meanwhile, Syrian government forces have pushed ISIS back from the ancient city of Palmyra—its withdrawal is part of a wider retreat for the extremist group, which by one estimate has lost almost a quarter (22 percent) of its territory in Iraq and Syria since January 2015. U.S. special-operations forces recently killed Haji Imam, a senior ISIS figure and possible successor to the leader Abu Bakr al-Baghdadi. Announcing Haji Imam’s death, U.S. Defense Secretary Ash Carter declared, “We are systematically eliminating [ISIS’s] cabinet.”

In mid-March, Putin announced he was withdrawing “the main part” of his Syrian expeditionary force, although significant numbers of troops, aircraft, and advisors would remain in place. Facing a potentially open-ended commitment that might turn into a quagmire, Putin apparently decided to quit while he was ahead. The stars, it seems, are aligning for a settlement.

But peace in Syria is not at hand. Although great-power backing may be necessary for an end to hostilities, it’s not sufficient. Resolving a civil war—especially an internecine inferno like Syria—is probably the toughest challenge in international diplomacy. Most internal conflicts end in decisive victory for one side, not a compromise deal. And it’s not hard to see why: How are groups that have been slaughtering each other for years supposed to put down their guns and learn to govern together?