(CNN)Back in 1989, Ayatollah Khomeini famously said he was "drinking poison" when he accepted a ceasefire to end the eight-year-old war with Iraq.  The war had helped define Khomeini's regime, the Islamic Republic, which he had founded a year before Saddam Hussein invaded Iran. Khomeini galvanized the nation, both his supporters and growing opponents, to fight against the enemy. He dragged out the war for eight years, despite Saddam's willingness to accept a ceasefire, and thus stabilized the foundations of the Islamic Republic. By the time he ended the war, the economy was in shambles, and there was no sign of his die-hard volunteers. Since then, "drinking a chalice of poison" has became part of Iranian political lexicon, and many analysts have asked whether Ayatollah Ali Khamenei, Khomeini's successor, would raise the chalice and surrender to demands by the West to end Iran's nuclear program. Like the war, Iran's defiance to halt its controversial nuclear program has defined Khameni's era. He has defied the West in the face of increasing economic pressure. Iran claims that its program is peaceful, but Khamenei's refusal to end uranium enrichment activities -- a process that can lead to making nuclear fuel as well as nuclear bombs -- has landed the country under crippling sanctions. The standoff with the West has stretched longer than the war. The agreement reached in Lausanne, Switzerland, however, marks a new chapter in the history of the country. If Iran can finalize a deal by June with the United States and its P5+1 partners, international investors, including Americans, would be able to invest in Iran for the first time in decades. Iran can develop its gas and oil fields, and the economy can leap forward. Desperate for a deal, whoever I called over the past week inside Iran was glued to their television sets, and tens of thousands poured out on the streets to celebrate the agreement late Thursday night. Iran's economy shrank after sanctions were intensified in 2012 and the value of the Rial, the Iranian currency, plunged to one-third of the U.S. dollar. Inflation soared and the bank accounts of ordinary Iranians were frozen overseas as a result of sanctions. Millions of Iranians are hoping that their lives will improve in the post-deal era. Despite the regime's propaganda that claimed the program enjoys wide support among people, critics inside the country publicly denounced nuclear policies. Ahmad Shirzad, a former member of parliament, denounced the program last year and said it had been "against national interests." Another critic, Sadeq Ziba, said in December "the nuclear program has hurt the country more than the war." Iranian politicians are divided between moderates -- led by President Hassan Rouhani, who wants to develop the economy -- and hardliners, who view the deal as a threat to the regime's ideology. The majority of people brought Rouhani to power in 2012, hoping that he would ease the sanctions. Many see the negotiations as a diplomatic necessity that would help sideline hardliners too. Yet the Lausanne agreement would not have been possible without the moderates' will and Khamenei's approval. Ayatollah Khamenei is 76. Last year, he underwent a long prostate surgery, which led to rumors that he might be gravely ill. His predecessor ended the war a year before his death. Whether Khamenei is seriously ill or not, many believe that because of his advanced age, he needs to put the country on a straight path before his death. So far, the regime has presented the deal as a win for itself. During 18 months of negotiations, the regime appeared determined not to succumb to Western demands and lose its right to uranium enrichment. The Lausanne agreement allows Iran to spin 5,000 centrifuges and avoid national humiliation. Khamenei can claim that Iran is the winner in the country's decade-long confrontation with the West -- a legacy that he wants to leave behind. He has not drunk the poison yet, not until June, when negotiators aim to iron out the final deal. But perhaps he has raised the chalice.
Iran's first Supreme Leader made a bitter peace with Iraq's Saddam Hussein . Nazila Fathi: Is current leader Ayatollah Khamanei trying to put Iran on right track before he dies?