Young Iranian men and women danced in streets in parts of Tehran and motorists honked car horns to cheer an historic nuclear accord with world powers they hope will end years of economic sanctions and decades of international isolation.
Millions of Iranians had followed the talks closely for months with the anticipation that Tuesday's deal would allow the economy, battered by years of sanctions, to stabilise and make their daily lives easier.
In the capital's affluent north, motorists played loud music from car stereos and young people blew South African-style 'vuvuzela' horns, scenes that Tehran normally witnesses only when the country qualifies the football World Cup.
Residents said police turned a blind eye to the festivities, and some even joined in. A woman in Vanak Square in north Tehran told Reuters by phone that people were buying sweets and handing them out on the streets.
Some young people draped the national flag over their shoulders, brandished posters of President Hassan Rouhani, made victory signs and shouted "Rouhani, thank you!"
Some carried posters bearing the words "Never give up on hope", a slogan associated with Mir Hossein Mousavi, one of two opposition politicians placed under house arrest in 2011 after protests by their supporters were crushed by the state.
Residents said public festivities were more subdued in less well-off south and east Tehran.
A news conference announcing the deal achieved in marathon talks in Vienna was broadcast live on state TV. So was a speech by US President Barack Obama, an event almost inconceivable until recent months. Iranians gathered around TVs at home and in shops to watch it.
'Friend with the world'
"This is a first step to becoming a friend with the world," Bahar Ghorbani, 36, a housewife who lives in Isfahan said.
"I think the biggest achievement of the nuclear deal is the victory of logic and dialogue over warmongering and violence," she said, contacted over Facebook.
The deal will mean an end to sanctions which have caused economic hardship, particularly over the past three years when Tehran was stripped of access to the international financial system, making it difficult to sell oil and pay for imports.
It was a triumph for Rouhani, a pragmatist elected overwhelmingly two years ago on a promise to reduce the isolation of the country of 80 million people.
"Today is the end to acts of tyranny against our nation and the start of cooperation with the world," Rouhani said in a televised address.
Voters who backed him said they now felt vindicated.
"Now people can see the result of their votes," Behrouz Janfada, head of an IT department at an education institute, told Reuters from Tehran. "Rouhani promised to solve the nuclear issue in his electoral campaign, people elected him and he managed to save Iran from the sanctions and the threat of a war. That brings hope, and the feeling that you have a say."
'Death to America' just last week
Hatred towards the United States remains a basic tenet of Iran's ruling system, on display just last week during an annual protest day that saw large crowds across Iran chanting "Death to America" and "Death to Israel".
Hardliners expressed doubt about the nuclear deal and had reservations about celebrations by reformists.
"This issue that a nuclear celebration will be taken over by only one faction will cause splits in society," said Hojatoleslam Hossein Sobhaninia, a senior cleric and parliamentarian, in an interview with the Fars News agency.
A police spokesman in Tehran said authorities would not intervene in the celebrations as long as no laws or religious morals were being violated.
Supreme Leader Ayatollah Ali Khamenei has endorsed the negotiations but has yet to speak about the deal itself.
Abbas Abdi, an influential reformist politician, told Reuters by telephone he did not mind suspending much of Iran's nuclear work to reach out to the world.
"The important part for me is that Iran has came to a mutual understanding with the world, and is not humiliated," said Abdi, one of the students who attacked the U.S. embassy in Tehran in 1979 and held 52 diplomats hostage for 444 days, a crisis that ended the relations of the two countries.
But not everyone was keen to party. Nassim, a 42-year-old graphic designer who said he struggled to make ends meet as an artist, said he would not celebrate until he saw improvements in his own life.
"I didn't go to the streets. It's like World Cup celebrations. What's in it for me?" he said. "Tehran's streets are full of expensive convertible cars. That's the effect of sanctions. Those who had money got richer, and the poor are still poor and will remain poor."