Mehdi Khalaji is a senior fellow at The Washington Institute for Near East Policy.

The recent presidential election in Iran proved that the Islamic Republic’s instinct for self-preservation trumps its ideology. Hassan Rouhani, the current representative of Supreme Leader Ayatollah Ali Khamenei in the Supreme National Security Council and former head nuclear negotiator, won the election in the first round, a total surprise for both international observers and domestic critics of the regime. Despite his establishment credentials and his status as a cleric, Rouhani was not regarded as Khamenei’s favorite candidate. Saeed Jalili, the chief nuclear negotiator; Mohammad Bagher Ghalibaf, former chief of the national police and current mayor of Tehran; and Ali Akbar Velayati, former minister of foreign affairs and Khamenei’s advisor on international affairs, were expected to have Khamenei’s support in this election. The nuclear impasse with Iran is by no means over, but at least the Iranian people have shown that they want a change of approach.

Many of those who voted for Rouhani may have thought like political prisoner Emad Bahavar, who said that while Rouhani is no pro-democracy figure, his victory may change the power equation in favor of democracy by weakening the military, political and economic institutions run by Khamenei. Rouhani is solidly in the conservative camp, but he ran a campaign positioning himself as the most moderate person allowed to run.

The main theme of Rouhani’s campaign was his critique of the Islamic Republic’s nuclear policy during the last eight years, which led to a series of U.N, E.U. and U.S. sanctions against Iran. Not only were the business community and private sector deeply damaged by sanctions, but the Islamic Revolutionary Guard Corps’s companies and government businesses also came under unprecedented pressure. The current policy left little hope for peaceful resolution of the nuclear crisis and, because of sanctions, made the impasse the first concern of many Iranian citizens, both urban and rural.

In the televised debates and his campaign, Rouhani has defended the pre-Ahmadinejad nuclear policy, which he ran from 2003 to 2005. He argued that he succeeded in keeping the nuclear program off the U.N. Security Council’s agenda while also preventing a significant interruption to the program. He said that Iran should change its negotiation pattern, assure the West that it is not after a nuclear bomb and save the economy from sanctions, while letting Iran’s peaceful nuclear program proceed. He described the 2003-04 decision to suspend uranium enrichment for a few months as a way for Iran to prove that the nuclear program is for peaceful purposes while at the same time make progress on the enrichment program during the suspension.

Rouhani’s victory can be interpreted as the success of the West’s policy toward Iran’s nuclear program. Since the start of sanctions, many have doubted whether sanctions are useful, and whether they would change Iran’s nuclear policy, but the 2013 election proved that sanctions deeply affected people’s opinions of the government’s policy of resistance rather than compromise. During the campaign, many of the candidates criticized the resistance approach, which was defended only by current nuclear negotiator Jalili. Even Velayati — who has been regarded as an influential advisor to the supreme leader— criticized Jalili in the televised debate,saying Jalili’s policy harmed Iran and produced zero benefit.

To be sure, sanctions weren’t the only reason Rouhani won. Unlike many classic dictatorships such as Iraq under Saddam Hussein, the political power in Iran is not monopolized by one group and person. Tiny holes that open in the election season sometimes provide a chance for new dynamism. Of course, elections in Iran are neither free nor fair because candidates are selected by Khamenei’s Guardian Council; in this election, the range of candidates approved was particularly narrow. To a considerable extent that helped Rouhani, because the candidates closest to Khamenei did not unify their constituencies. Without any one candidate having the clear support of the Supreme Leader or the Revolutionary Guards, the hard-line vote was split.

And there are some indications that Khamenei might not have been totally in support of Rouhani’s rivals. In an unprecedented statement few days before the election, he asked the opponents of the Islamic Republic to participate in the election for the sake of the country. This was the first time that Iran’s supreme leader asked for help from the Islamic Republic’s opponents. And in one of his campaign speeches, Rouhani said, “Let me tell you vaguely that what happened in 2009 would not happen in 2013” — implying that this time, Khamenei’s team would pay attention to people’s votes. Unlike 2009, there was no serious report of fraud in the election and all candidates accepted the results.

Nevertheless, the West now should have more confidence in the negotiations because the Iranian people showed that they are not indifferent to the leverages used against nuclear policy — and indeed the hard-line elite showed it is deeply split over how to proceed on the nuclear front. But one should not forget that Rouhani’s justification for negotiations during the campaign was to relieve the pressure without giving up the program. This means that while the West should approach negotiations with cautious optimism, the West has to remain insistent on Iran having only a peaceful nuclear program that is verifiably far from a nuclear weapons capability. And of course, Iran’s president does not dominate Iran’s foreign and security policy, which is overwhelmingly set by Khamenei, though the fact that Khamenei allowed Rouhani to win suggests that Khamenei himself may be open to a shift in approach.