They rose to their feet in ecstatic surprise, shouting “heydar, heydar” – a Shia victory chant.
This was the first public appearance of their supreme leader since Israel began attacking their country.
He emerged during evening prayers in his private compound. He said nothing but looked stern and resolute as he waved to the crowd.
He has spent the last weeks sequestered in a bunker, it is assumed, for his safety following numerous death threats from Israel and the US.
His re-emergence suggests a return to normality and a sense of defiance that we have witnessed here on the streets of Tehran too.
Earlier, we had filmed as men in black marched through the streets of the capital to the sound of mournful chants and the slow beat of drums, whipping their backs with metal flails.
This weekend they mark the Shia festival of Ashura as they have for 14 centuries. But this year has poignant significance for Iranians far more than most.
The devout remember the betrayal and death of Imam Hussein as if it happened yesterday. We filmed men and women weeping as they worshipped at the Imamzadeh Saleh Shrine in northern Tehran.
The armies of the Caliph Yazid killed the grandson of the Prophet Muhammad in the seventh-century Battle of Karbala.
Shiite Muslims mark the anniversary every year and reflect on the virtue it celebrates, of resistance against oppression and injustice.
But more so than ever in the wake of Israel and America’s attacks on their country.
The story is one of prevailing over adversity and deception. A sense of betrayal is keenly felt here among people and officials.
Many Iranians believe they were lured into pursuing diplomacy as part of a ruse by the US.
Iran believed it was making diplomatic progress in talks with America it hoped could lead to a deal. Then Israel launched its attacks and, instead of condemning them, the US joined in.
Death to Israel chants resounded outside the mosque in skies which were filled for 12 days with the sounds of Israeli jets. There is a renewed sense of defiance here.
One man told us: “The lesson to be learned from Hussein is not to give in to oppression even if it is the most powerful force in the world.”
A woman was dismissive about the US president. “I don’t think about Trump, nobody likes him. He always wants to attack too many countries.”
Pictures on billboards nearby draw a line between Imam Hussein’s story and current events. The seventh-century imam on horseback alongside images of modern missiles and drones from the present day.
Other huge signs remember the dead. Iran says almost 1,000 people were killed in the strikes, many of them women and children.
👉Listen to The World with Richard Engel and Yalda Hakim on your podcast app👈
Officially Iran is projecting defiance but not closing the door to diplomacy.
Government spokeswoman Dr Fatemeh Mohajerani told Sky News that Israel should not even think about attacking again.
“We are very strong in defence and as state officials have announced, this time Israel will receive an even stronger response compared to previous times,” she said.
“We hope that Israel will not make such a mistake.”
But there is also a hint of conciliation: Senior Iranian officials have told Sky News that back-channel efforts are under way to explore new talks with the US.
Israel had hoped its attacks could topple the Iranian leadership. That proved unfounded, the government is in control here.
For many Iranians, it seems quite the opposite happened – the 12-day war has brought them closer together.