The Laylat al-Qadr, or Night of Destiny, marks the moment when the Prophet Mohammad (pbuh) received the words from God that would become the Quran.
It is an auspicious occasion when the gates of heaven are open and prayers have the best chance of being heard -- the Quran says this night is worth more than 1,000 months.
Many people's prayers turn to the conflicts in which Iran is locked across the Middle East.
"We have come to pray for all the combatants of Islam. God willing, Daesh will disappear," said Issa Eftekhari, 53, using an alternative name for the Islamic State group.
Iran thwarts 'biggest terrorist plot ever'
He was one of thousands gathered at the glittering mosque in Tajrish Square in northern Tehran on a balmy Sunday evening, bringing a festive atmosphere despite the city's notorious traffic being even worse than usual.
Laylat al-Qadr brings together the contrasting classes of Tehran society -- teenagers in jeans with dyed hair poking out from colourful headscarves, sitting alongside more conservative women with black veils pulled tightly over their heads.
It is a long event, with recitals lasting until after suhur, the last meal before fasting resumes.
Families and friends sat with picnics, passing round sweet dates and tea, while children dozed in their parents' arms as lilting Quran recitals came over the speakers.
Iran says five rebels killed in Kurdish region
When it came time for prayers, many held the Quran against their heads, a gesture meant to reinforce their requests.
"I'm praying for the sick, and that everyone is safe and well... I hope that my country will always be great and proud," said 13-year-old Assal, attending with her family.
Concerns about the bigger regional problems are shared by a senior cleric, Mohammed Peikeri, at a nearby religious school.
"We pray for everyone, but the most important hope is that people distance themselves from fanaticism," Peikeri told AFP.
"What is really important for Shias on these nights... is to acquire knowledge. We say that the ignorant and the obsessed are not accepted by God. Reason must be at the centre of religion," he added.
"That is why we oppose extremist groups, because when someone has a cause based on reason, they no longer need force."
Because the exact date of Prophet Mohammad (pbuh)'s revelation is not known, the ceremonies are repeated on three nights in Iran.
Islamic State encourages more attacks during Ramazan in latest audio message
The second carries particular importance for Shia Muslims since it also marks the killing of Imam Ali in the seventh century, who they consider to have been the rightful heir of the Prophet.
It is this issue that triggered the split between Sunnis and Shias and gives a religious underpinning to today's regional rivalries, particularly between Iran and Saudi Arabia.
But for many on this holiest of evenings, geopolitics takes a back seat to more personal hopes for renewal.
"People come to seek forgiveness for their mistakes," said Said Hatami-khah, one young man at the Tajrish Mosque. "They come to restart their lives as if they were reborn."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ