Five years ago this week, Syrian President Bashar al-Assad gave a television address about the largely peaceful protests against his rule. “Let us act as quickly as possible to heal our wounds and restore harmony to our larger family and maintain love as our uniting bond.” But there was a sting in the tail: “Burying sedition is a national, moral, and religious duty.” Government repression of the demonstrators and the radicalization of the opposition transformed a campaign of political resistance into a brutal sectarian war, in which at least 300,000 Syrians have died millions have become refugees, and regional and global powers have pursued the great game of proxy conflict. But with peace talks ongoing in Geneva, and a partial ceasefire in place, is the conclusion of the war finally in sight?

In November 1942, after Allied victories in North Africa during World War II, British Prime Minister Winston Churchill declared: “Now this is not the end. It is not even the beginning of the end. But it is, perhaps, the end of the beginning.” Churchill’s phrase is apt as the Syrian conflict potentially transitions into a new era based on a limited peace settlement. But the obstacles to a deal remain significant, and the odds of a return to unrestrained warfare are quite high. When Churchill spoke in 1942, there were still two and a half years of fighting in Europe to go. And the Syrian Civil War may have at least that much longer to run.

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?

The negotiations in Geneva may look futile. All sides are demanding seemingly impossible goals. The Syrian government refuses to even talk directly with the rebels. Instead, the UN’s special envoy of the secretary-general for Syria, Staffan de Mistura, shuttles between the various sides, listening and carrying messages—a job that requires saintly patience. The Syrian rebel umbrella group, the High Negotiations Committee, demands the ouster of the entire current leadership of Syria, including Assad, and the creation of a new interim government. Meanwhile, the regime refuses to even discuss Assad’s role or possible elections. Damascus is emboldened by recent battlefield success. If Assad can survive five years of war—after being written off by the Americans and other observers—he can endure a few diplomatic parries and thrusts in Geneva.

And these are not just peace negotiations. In a sense, they’re alliance negotiations. The regime and the rebels are meant to stop fighting each other and turn their weapons on ISIS. This means that even if a deal were reached, the war wouldn’t end—the coalitions would simply shift. And if somehow ISIS were pushed out of Syria, the extremist group wouldn’t sign a surrender document. Instead, ISIS would wage a vicious campaign of terrorism to try to reclaim its lost caliphate.

Accommodation and compromise are thus in scant supply in Geneva. And though the main “extremist” parties are excluded from the talks, and only the “moderate” rebels are invited, these are relative terms in the Syrian context. Consider two of the rebel groups that made the grade: Jaish al-Islam and Ahrar al-Sham. Jaish al-Islam’s former leader discussed cleansing Syria of Shiites and members of Assad’s Alawite sect, and the group produced a video showing the execution of ISIS prisoners. Meanwhile, Ahrar al-Sham seeks Sharia law in Syria, and has denounced Staffan de Mistura as a lackey of Assad, although they eventually agreed to turn up in Geneva. Both groups have cooperated with al-Nusra—in other words, they’re affiliated with an al-Qaeda affiliate. In any other conflict, these militias would be at the extreme end of the scale.

And that’s just the rebels. The Syrian regime is utterly brutal and has used chemical weapons, barrel bombs, and systematic torture against its own people. To complete the parade of horribles, according to Amnesty International, Russia, the supposed peacemaker, deliberately bombed hospitals in opposition-held regions.

Despite all this, a measure of progress is possible. All civil wars end—this is an obvious point, but one that can be easily be forgotten when contemplating the horrors of Syria. Negotiations have resolved seemingly intractable conflicts in countries like El Salvador, South Africa, Cambodia, Guatemala, and Northern Ireland.

If the combatants in Geneva are obdurate, negotiators shouldn’t give up. In peace talks, it’s normal for belligerents to open with their maximum position and demand their enemies’ surrender. For one thing, all sides are uncertain about their adversaries’ goals and confidence in victory, and they need to sound them out. And combatants also worry that any concessions they offer will just be pocketed without their receiving anything in return, and even worse, could signal weakness that encourages the enemy to go in for the kill.

That changes over time, as negotiating positions often move closer together and the sides start looking at the same battlefield realities. They quietly abandon their more extreme demands. Beneath the vitriol, belligerents may find some common interests, such as ending the violence and taking on mutual foes—in this case, ISIS. Indeed, despite the carnage and apocalyptic language, the regime has reached local bargains with rebel groups before: For example, to allow the removal of besieged rebel fighters in exchange for the evacuation of civilians.

Tentative hopes for a negotiated deal may easily be dashed. The regime could use the partial ceasefire to rest and redeploy its forces, while remaining committed to a military victory. But the renewed urgency of great-power involvement in the process, and the fact that many key players are in Geneva at all, suggests the possibility of change.

We may be moving out of Phase I of the war, where all sides sought decisive victory, and into Phase II, where the regime and major rebel factions reach an accord. This could be an informal understanding to direct their fire against ISIS and al-Nusra, or it may include the beginnings of a formal deal to devolve political power to the regional or local level and possibly ease Assad out of office. Eventually, if ISIS and al-Nusra are pushed back, we may enter Phase III, or the stabilization of Syria in the face of a continued terrorist campaign. This will be the truly hard part—and will require a major international commitment.

The end is not in sight. But the end of the beginning is in sight.