Less than two months ago, Yemen’s civil war threatened to engulf the broader Middle East. The stalemate between Iranian-supported Houthi rebels and forces backed by a Saudi-led coalition had already killed an estimated 100,000 people and spawned what the United Nations considered the worst humanitarian crisis in the world. If that wasn’t bad enough, a split in August within the fragile anti-Houthi alliance risked igniting a civil war within a civil war. And an attack claimed by the Houthis on Saudi Aramco oil facilities in September provoked threats of retaliation against Iran by Riyadh and Washington. Both within Yemen’s borders and in the wider region, further bloodshed seemed inevitable.

Yet, in an unexpected turn of events, these flare-ups appear to have opened a pathway to peace. On November 5, the chief rivals within the anti-Houthi bloc—the internationally recognized government of President Abd-Rabbu Mansour Hadi and the separatist Southern Transitional Council (STC)—signed a power-sharing deal known as the Riyadh agreement. The deal was brokered by Saudi Arabia, which took parallel steps to ease its own cross-border conflict with the Houthis, expanding dialogue with the rebels and limiting air strikes in Yemen. The Houthis have halted all attacks on Saudi Arabia, and a broader Saudi-Houthi de-escalation initiative is now reportedly being discussed. If both the Riyadh agreement and the Saudi-Houthi initiative survive, and UN mediators are able to weave them into a single negotiation track, a national political settlement could be possible.

That is a big if. Reaching a national political settlement in Yemen will require both winding down the Saudi-led military intervention and bridging the gaping divides among the country’s many armed groups and political factions. It is entirely possible that current negotiations will grind to a halt or fall apart. If that happens, the conflict will likely deepen and expand. Saudi Arabia and Iran will both intensify their struggle for influence, and Yemen will dissolve further into a mess of warring mini-states, each with its own international backer.

AN OPENING FOR PEACE

Yemen’s descent into civil war began in 2014, when Houthi rebels seized control of the capital, Sanaa, forcing Hadi’s government to retreat to the southern port city of Aden and then to Riyadh the following year. Saudi Arabia saw the Houthis as an Iranian project, and led a regional military intervention to roll them back. But the conflict quickly took on complex local and regional dimensions. The alliance of Yemeni forces the Saudis helped to assemble was unified in theory, but in practice its members acted independently, and often at cross-purposes.

The division of labor between Saudi Arabia and the UAE also created problems. In early 2016, the two Gulf monarchies agreed that Riyadh would work with its allies in northern Yemen to fight the Houthis, while the UAE, which had previously helped Yemeni fighters push the Houthis out of Aden, would build up new forces in the south. But even though the Emiratis nominally supported Hadi, they didn’t want to work with Islah, a Sunni Islamist party with ties to the Muslim Brotherhood that is part of Hadi’s coalition. Instead, the Emiratis backed the STC, an anti-Brotherhood southern secessionist group that saw Islah members as northern “invaders” akin to the Houthis.

The veneer of unity was shattered altogether in August, when the STC turned its guns on Saudi-backed forces loyal to Hadi, forcing them out of Aden. The split handed the military advantage to the Houthis, and threatened additional bloodshed. But eager to prevent a collapse of the anti-Houthi front, Riyadh corralled the STC and the Hadi government into a power-sharing deal. If the Riyadh agreement holds, it won’t just prevent further infighting among anti-Houthi factions; it will create a more representative Yemeni government that the Saudis can better wrangle toward a national peace accord.

The Saudis appear to have concluded that even if they can’t beat the Houthis militarily, they must at least drive a wedge between the rebels and their Iranian backer.

Relations between the Houthis and the Saudis have also improved. The Saudi Aramco attack alarmed pragmatists inside the Houthi movement who were reportedly wary of being drawn into a regional war alongside Tehran. With Riyadh shaken, they saw an opportunity to shift course. On September 20, the Houthis announced a unilateral suspension of drone and missile strikes on Saudi Arabia. They asked the Saudis to suspend their own strikes and to ease restrictions on imports to Houthi-controlled areas of Yemen, which have suffered from food and fuel shortages due to a Saudi-led blockade.

Riyadh responded positively, dialing back cross-border attacks in certain areas, facilitating fuel imports, and reopening backchannel discussions that have reportedly developed into direct talks. The Saudis were clearly unnerved by the U.S. response to the Saudi Aramco attack, which exposed the unreliability of the U.S. security umbrella. They are also keenly aware of the potential costs of open conflict with Iran. As a result, Riyadh may be trying to ensure that Yemen doesn’t become an even more combustible flashpoint on its southern border. The Saudis appear to have concluded that even if they can’t beat the Houthis militarily, they must at least drive a wedge between the rebels and their Iranian backer with financial and political inducements. To succeed, however, they will need to win over or at least mitigate the influence of Houthi hard-liners while strengthening the hand of Houthi pragmatists by reducing the level of violence, delivering economic gains, and ultimately an end to cross-border hostilities.

Saudi Arabia’s interest in reviving talks with the Houthis was probably influenced by the UAE’s recent decision to draw down its forces in Yemen. The Emiratis began withdrawing their troops earlier this year because they saw little reason to keep fighting after a previous UN-brokered peace agreement halted their advance on the vital Red Sea port of Hodeidah. The decision to withdraw was likely also connected to the UAE’s concerns about heightened tensions with Iran and the need to focus on its own security. Saudi Arabia is now in the process of taking over command of the coalition in Aden, sending large numbers of ground troops to the south.

Combined, all of these developments form a pathway to a political settlement in Yemen, the most promising that diplomats and UN officials say they have seen in years. In a best-case scenario, the STC and the Hadi government would both mostly adhere to the Riyadh agreement. At the same time, the Saudis and the Houthis would formalize their de-escalation process and agree on how to reduce Tehran’s influence. Both steps would strengthen the position of Houthi pragmatists and reassure Saudi Arabia that it can safely support a peace process in Yemen without jeopardizing its own interests. Finally, the United Nations, with support from regional powers, especially the Saudis, would mediate talks between the now more inclusive Hadi government and the Houthis. The goal would be a cease-fire and then a national political settlement.

A LONG WAY TO GO

A lot could still go wrong. A Houthi missile fired into Saudi Arabia that kills civilians, or a Saudi air strike that kills Yemeni civilians, could restart the cycle of violence. There is also a risk that Saudi Arabia will use the agreement between the STC and the Hadi government not to pursue peace talks but to ramp up the war effort against the Houthis. That is the fear of many diplomats and analysts, and the wish of some anti-Houthi groups and officials in Hadi’s government.

Just as tenuous is the Saudi-brokered deal between Hadi’s government and the STC. Enmity between the two factions still runs high, and officials from both groups express pessimism over the agreement’s durability. The signing ceremony was delayed repeatedly, thanks at one point to fighting between government and STC forces. The STC wants an independent south and will try to use the agreement with Hadi’s government to strengthen its domestic position and boost its international profile. For its part, the Hadi government will work to subvert the STC’s political ambitions and to weaken its military capacities.

The deal is also vaguely worded and offers little guidance on implementation. It sets an unrealistic timeline for integrating rival military and security forces, and leaves unanswered how this integration is supposed to happen—shortcomings that mirror past failed intra-Yemeni agreements. The government and STC have both trumpeted the deal as a win for their side; neither has shown any willingness to cede real power to the other. There are also concerns about Riyadh’s capacity to manage implementation of the accord. And given Riyadh’s continued support for Hadi, some in the president’s camp could conclude that they have the upper hand. If Hadi’s government grows overconfident, it could provoke renewed fighting with the STC.

Even if the southern power-sharing deal holds and the Saudi-Houthi de-escalation process stays on track, the road to durable peace in Yemen will be long and circuitous.

Even if the southern power-sharing deal holds and the Saudi-Houthi de-escalation process stays on track, the road to durable peace in Yemen will be long and circuitous. Some five years of fighting have swept away large parts of the old order and changed the political landscape of the country. At the beginning of the war, both the Houthis and the STC were emerging powers. Now they are dominant poles of influence, the former controlling the country’s northwest and the latter Aden and its immediate surroundings. A third center of power is the Hadi government and its allies, including Islah and anti-STC southerners who control provinces to the east of Houthi and STC areas.

Much will turn on Saudi Arabia’s ability and resolve to manage the two different strands of negotiations, and to eventually convince the Hadi government that it must sue for peace with the Houthis. But even as the Saudis facilitate intra-Yemeni negotiations, it is the Yemenis who will determine the outcome. A settlement to the swirling conflicts in Yemen is arguably closer now than at any point in the last five years, but that doesn’t mean that peace is around the corner. Some of the country’s unresolved issues—such as the question of whether the south will secede—may result in more violence no matter what diplomats achieve. Still, there is now a rare window of opportunity to begin winding down the war. It should not be missed.