After decades of negotiations, the permanent five members of the U.N. Security Council and Germany — known as the P5+1 — and Iran finally delivered an agreement to end Iran’s nuclear weapons program this week. The next few months of honest engagement, monitoring, and a robust inspections regime will tell us how successful the deal actually is in its primary goal: stopping Iran’s nuclear weapons program.

Why did Iran choose to reverse its nuclear course? And why now, after myriad bilateral and multilateral attempts, many all-nighters in Geneva, Lausanne, and Vienna, and despite the Supreme Leader (and considered to be the most powerful political authority in Iran) Ayatollah Ali Khamenei’s pessimism over reaching a deal?

My research reveals that when the international community comes to the bargaining table to discuss a nascent nuclear weapons program, new leadership can offer unique opportunities for countries to change stance and save face. My book project on nuclear reversal traces the trajectory of all countries that have started and stopped nuclear weapons activities, 27 out of 36 countries. Most of these potential proliferators positively responded to the United States’s offer of rewards (often military or economic assistance) to replace sanctions (whether threatened or already in place). That’s what happened this week with Iran. This deal confirms the importance of offering carrots even with hardline proliferators, despite political pressure not to.

When leaders change, so can nuclear policy

Carrots are especially useful when offered to countries where the leadership is changing. New leaders like President Hassan Rouhani, upon arriving in office, often reveal a desire to reverse the country’s nuclear weapons course. This may be through public statements that tone down a previous administration’s rhetoric about the need for nuclear weapons or through engagement with the international community in a new round of talks.

For the new leader, this sort of signaling offers several key benefits. First, as the country reassesses its motivations for nuclear weapons, a sign that policy may be changing could help prevent a potential preemptive military strike. Second, these signals exploit a natural change in leader personality and policy preference, without necessarily negating a previous administration’s position on nuclear weapons or jeopardizing international standing. Lastly, this shift allows a new leader, like Rouhani, to reap the benefits — both economically and politically — of being credited with bringing in military and economic assistance and ending years of crippling sanctions and political isolation.

Nuclear reversal following leadership change is a more common occurrence than many people believe. Among the 27 states that have started and stopped nuclear weapons activity since 1945, 14 — including Australia, Italy, and Taiwan — changed leadership less than 12 months before beginning negotiations that permanently stopped their nuclear weapons program. These leaders use their new positions in government to reveal their countries’ desire to end their nuclear weapons program in exchange for whatever rewards the international community was offering at the time. Many of these countries received significant increases in military assistance from the United States immediately after publicly deciding to stop a nuclear weapons program.

Iran’s Rouhani used his rise as an opportunity for change

President Rouhani’s approach to negotiation on the nuclear weapons issue since his arrival in office in 2013 illustrates this clearly. Since the end of the Ahmadinejad administration, the P5+1 and Iran (with Rouhani and Foreign Minister Mohammad Javad Zarif at the helm) have worked continuously to find a resolution to the Iranian nuclear weapons program despite various political roadblocks. This has taken two long years of often frustrating talks, against the backdrop of a very important and outspoken critic, Khamenei.

But through his rise to power, Rouhani has demonstrated his changing desire for nuclear weapons — or perhaps more realistically, his desire to end sanctions. That reinforces the historical evidence: New leaders have a unique opportunity to reveal their nations’ preference to shift course and to reengage the international community.

How and when to try to halt nuclear proliferation

What are the implications of this historical pattern for dealing in the future with countries ambitious for nuclear weapons?

First, understanding this history will help us further refine U.S. nonproliferation and counterproliferation policy. Knowing that there are specific moments in a country’s nuclear trajectory when an agreement is more likely enables diplomats to capitalize on these domestic political changes — thus potentially saving a lot of time, money, and effort for both the U.S. and the prospective proliferator.

That is not to say that reversal always happens when leadership changes. While some leaders like Rouhani use their position to negotiate nuclear reversal, others like Kim Jong Un of North Korea use their rise to power to persist down their nuclear path. But this research does point to an important opportunity for U.S. engagement and diplomacy.

Second, and perhaps more important, this research offers hope. Seemingly intransigent hardliner countries do sometimes stop their nuclear weapons programs without military force. Nuclear proliferation is not inevitable. Bombing is not absolutely essential to preventing proliferation. When new leaders come in, it’s an opportunity to offer new rewards. That may be the most effective approach in keeping the nuclear club small.

Rupal N. Mehta is an Assistant Professor in the Department of Political Science at the University of Nebraska-Lincoln and a Stanton Nuclear Security Postdoctoral Fellow at the Belfer Center for Science and International Affairs at the John F. Kennedy School of Government at Harvard University.