The signing of the nuclear accord between Iran and the P5+1 answered a question that has bedeviled the U.S.-Iranian relationship for 36 years.

Decades after the 1979 uprising that ousted Washington’s ally, Shah Reza Pahlavi, and led to the 444-day captivity of American hostages at the U.S. Embassy in Tehran, the United States is no longer intent on effecting regime change and settling scores. The nuclear accord signifies a belated acceptance of, and accommodation with, the Islamic Revolution and the clerical order it spawned.

What does this mean for Iran? That a relaxed leadership can now look inward to fix the country’s ailing economy. But what if it also decides to invest further into Iran’s power projection in the region?

First the good news: The accord deserves to be embraced unabashedly as both necessary and sufficient, on moral as well as geostrategic grounds. It isn’t that one can trust either Iran or the United States to implement the deal to the letter, especially once these governments come under new management: Iran holds parliamentary elections in February 2016; the U.S. presidential elections follow in the fall, and Iran’s presidential polls a year later. Nor that Iran can be expected to temper its long-term nuclear aspirations. But any successful effort to reduce or push back the chances of war over the nuclear issue must be warmly applauded, and this particular agreement has two important additional assets: it reflects a rare — and very welcome — international consensus in bewildering times for the globe, and it constitutes a victory of diplomacy over options that are so much worse.

So hurrah! Well done!

Yet it’s fair to ask if now, thanks to this deal, we’re out of the woods. Looking at the Middle East, the answer must be an unequivocal no. This doesn’t make the nuclear deal any less necessary or praiseworthy; failure to reach one would have imperiled more than the Middle East. But it means that concerted efforts will now need to be made to fix a region that is increasingly coming undone, whose conflicts are spilling across borders, and that has generated both a humanitarian crisis of unprecedented proportions and a transnational jihadi threat to which we have yet to find an effective response.

While the talks that led to the nuclear accord — involving the United States, the United Kingdom, France, China, Russia, Germany and the European Union — were carefully walled off to prevent the intrusion of other pressing concerns, such as the wars in Syria or, more recently, Yemen, they were not merely about the complex technical problem of how to clip Iran’s nuclear wings. For the Obama administration, blocking all possible pathways to a bomb, establishing airtight verification mechanisms, and ensuring sanctions will be snapped back into place if Iran attempts a nuclear breakout together amount to circumscribing Iran’s ascendant power in the region. If fully observed, the deal guarantees that we will be able to tackle, and attempt to settle, conflicts in the Middle East for the next 15 years at a minimum without the shadow of nuclear blackmail — at least by Iran.

This won’t suffice to reduce growing tensions. Yet how seriously should we take the threat that Iran, rather than coming around from decades of isolation, reinforces it by stepping up its entanglements in the Gulf and the Levant? In respect of the latter, Iran’s leaders may find they have little choice, but it’s not as if they have much to cheer about: Tehran’s military backing of the tottering governments of Syria and Iraq is a direct result of its failure to protect these allies from internal upheaval through the use of its soft power.

In Syria, rather than encouraging Bashar Assad to reach out to demonstrators in the uprising’s early days, Tehran supported him when he cracked down. His violent response provoked an escalation into all-out civil war, and his loss of control over most of the country. If he survives today, it is only because of the military role Iran and its ally Hezbollah have played to protect the regime’s core assets. It is difficult to see how Assad could ever rule all of Syria again, or how Iran could maintain its vital link to Lebanon and Hezbollah when the Assad regime collapses — as well it may if Tehran fails to negotiate a transition that would end Assad’s rule while preserving Iran’s own strategic interests.

In Iraq, Prime Minister Nouri al-Maliki’s autocratic tendencies and sectarian-imbued repressive policies further alienated a Sunni population that, as soon as the opportunity presented itself, threw in its lot with the Islamic State (IS), despite the latter’s brutal rule. Iran could have acted to moderate Maliki’s behavior but neglected to do so, content that a friendly Shi’ite Islamist coalition ruled a neighbor that, barely a generation ago, had launched a destructive eight-year war against it. The Iraqi army’s collapse in the face of Islamic State’s advance in June 2014 created a security vacuum that Iranian military advisers have tried to fill by commanding urgently mobilized Iraqi Shiite militias. But what will the proliferation of such militias do for the unity of the Iraqi state, which Iran claims to want to preserve? The country’s breakup into warring fiefdoms is now a more likely scenario.

Only in Yemen has Iran made headway, but this was hardly the result of its own doing. The Houthis exploited Saudi political fumbling when they marched virtually unopposed into Sanaa and parts south earlier this year, aided by forces allied with the former leader, Ali Abdullah Saleh. The Iranians were quick to take credit, and also to wave the flag, presumably to poke their Saudi rival in the eye and dissuade it from escalating its support for Syrian rebels. Yet this has amounted to very little in material terms. Iran’s role in Yemen remains mostly cost-free, and the country is too far from its shores to appear to warrant a major investment of resources. Nor would it be difficult for Iran to turn its back if/when the costs become too great, as they may now that a Saudi-led coalition has started to reverse the Houthis’ gains.

In other words, Iran cannot be said to have significantly expanded its influence in the region, but rather to have been forced to provide military protection to pivotal allies it risked losing. If this has caused panic in Riyadh, it’s mainly because of the Arab world’s state of disarray. The regional order that emerged out of the competition between Arab nationalist forces and conservative regimes in the 1950s and 1960s has rapidly come apart. The Arab Spring popular protests opened the door to Islamist groups, who are stepping into the political vacuum left by an exhausted state system, but Saudi Arabia, which is their ideological progenitor, has not been able to benefit. Instead, it is itself threatened by these groups, which consider the Saudi royal family illegitimate rulers of Islam’s holiest sites.

Saudi leaders have much to answer for. For decades they have actively worked to allow an extreme, intolerant strain of Islam to come to the fore in the Muslim world by spending billions on the construction of mosques, the distribution of literature, and the promotion of clerics prepared to do their bidding. The chickens are now coming home to roost: the new generation of jihadis has embraced the Saudi leadership’s religious ideology but — seeing its profligacy and corruption — rejects its right to govern. To ward off the danger, the late King Abdullah targeted the Muslim Brotherhood, a mainstream rival to the Saudi royal family, including by helping foment the group’s downfall in Egypt. His successor, King Salman, perhaps recognizing that the real threat derives less from the Muslim Brotherhood than from the radicalization its suppression entails, has tried a different tack, mobilizing the Sunni Muslim world against the perception of Iranian aggression. Support of the Saudi-led air assault on Yemen has been significant throughout the Sunni Muslim world, despite the immense suffering the often indiscriminate bombardments have caused, because the target is a (nominally) Shiite group that has declared affinity with Iran and Hizbollah–regardless of the absence of any significant Iranian involvement.

The contest between Iran and Saudi Arabia is destabilizing the entire region, with global consequences, and neither seems to have a workable strategy to exit the conflicts in which they are embroiled. At the heart of their competition lies Syria, a majority-Sunni country ruled by a minority regime allied with Iran. Riyadh has long wanted it to return to the “Arab fold”; the 2011 revolt offered an excellent opportunity, even though the protesters were fired by their opposition to autocracy (including, in theory, the Saudi variety) more than to rule by a particular sect. However, deep divisions among the rebels’ supporters (Saudi Arabia, Qatar, Turkey, and the U.S.) helped create today’s military stalemate with its attendant humanitarian catastrophe.

If things are beginning to move again in Syria today it is in part because Turkey has decided to become more active in the north. IS has been extending its reach, and moreover has begun carrying out attacks inside Turkey. If this is a concern for Turkish leaders, even more so is their perception of an Iranian ascendancy. They have watched with alarm as the Syrian branch of the PKK, the Tehran-allied Kurdish rebel party in Turkey, has tried to ingratiate itself with the United States by joining the battle against IS in both Syria and Iraq, and showing itself an effective fighting force. President Recip Tayyep Erdoğan is in the midst of a political struggle, hoping to expand his powers following elections in November; playing the nationalist (anti-PKK) card may win him the votes he needs for his AK party to form a government without coalition partners.

King Salman’s strategic shift of focus was pleasing to Erdoğan, who promptly visited Riyadh, finding that he and the king could see eye to eye on most issues, with the exception of Egypt, which they agreed to put aside. Iran’s return to regional status, therefore, faces a tentative, uneasy “Sunni” alliance between Saudi Arabia and Turkey, with the U.S. trying to balance the three in pursuit of its own interests.

Many have found Washington’s Mideast policy mystifying, if not outright wrongheaded. They blame the Obama administration for abandoning its friends during the Arab Spring and then further destabilizing the region by opening the door to Iran — allowing Shiite Islamist parties to run Iraq; refusing to provide the kind of support that would have allowed Syrian rebels to topple Assad; and ratifying Iran’s regional standing via the newly signed nuclear deal — again at the expense of its Gulf allies. The Saudis may also feel that Iran is being rewarded for seeking to re-enter from its rogue orbit the constellation known as the international community without being asked to rein in its ambitions, and that as a result they are getting the short end of the stick despite being Washington’s longtime, reliable ally.

Obama does appear to have a strategy, however; it’s called “tough love,” involving qualified backing of Washington’s Gulf allies. While the administration has provided half-hearted support for the Saudi air war on Yemen, it has also delivered a warning that if Gulf states fail to take steps to put their own house in order, they are simply inviting outside parties like Iran to take advantage of their internal weakness and regional missteps. The administration’s approach is, of course, also based on the realization that the United States no longer enjoys its global reach of yesteryear, and that direct military intervention in the Middle East, of the kind that has proved counter-productive in the past, would merely put a spotlight on this discomfiting fact.

Thus we have seen only a limited U.S. military projection in the region (seeking to contain IS – but barely – through airstrikes). What we have not seen is a more proactive diplomatic initiative to reduce tensions. U.S. officials hinted until recently that a more assertive posture could have undermined the nuclear negotiations with Iran. But now that an accord is in place the administration has both the opportunity and an obligation to work with the principal parties to start to defuse the rampant conflicts plaguing the region. The fact that the United States and Iran have established a solid channel of communications and, over the past couple of years, have built a modicum of mutual trust should be of tremendous help in this respect.

Their focus, first and foremost, should be on Syria. (In Yemen, Iran remains little more than a background player, and has shown it will step back when pressed to do so, as when it agreed last June to send a ship — laden with humanitarian aid but accused of carrying weapons — to dock in neighboring Djibouti for inspection by the United Nations rather than, provocatively, in Houthi-controlled Hodeida.) The opportunity to negotiate a deal over a Syrian transition is now – before Washington and Tehran fritter away the chips of their fragile rapprochement in mutual recriminations, as implementation of the nuclear deal hits a bump or goes off-track. Whether Iranian leaders will agree to a change in Syria that would still protect their country’s core interests (as per ideas outlined by the International Crisis Group last April) or instead decide to double down in their support for Assad’s faltering regime is a matter of conjecture. But accumulated mutual goodwill and the priceless experience of negotiating a complex treaty could and should be deployed to seek a negotiated way out.

In sum, the nuclear deal has not removed the question of the Iranian threat but reframed it. Saudi Arabia and other Gulf states have been faced until now with what they saw as two bad futures: a nuclear-armed Iran throwing its weight around in the region or a non-nuclear Iran friendly with the United States doing so. With the signing of the Vienna agreement, a decision has been made for them. We are far from seeing the emergence of a new U.S.-Iran alliance, but the taboo has been broken and the first critical hurdle overcome. So now is the moment for diplomacy, not escalation. If there is anything significant Obama could add to his legacy during his final year in office, it would be to take the lead in guiding his partners in the region toward a less confrontational posture.