“Accordingly, the remembrance of Allah and the invocation of blessings upon His Messenger become especially stressed when one is about to rise from a gathering. The Sunnah is realized with any wording of remembrance or blessing, yet the most perfect form of remembrance is: ‘Subhānaka Allāhumma wa bi-ḥamdik, ash-hadu an lā ilāha illā Anta, astaghfiruka wa atūbu ilayk’ (Glory be to You, O Allah, and with Your praise; I testify that there is no deity but You; I seek Your forgiveness and turn to You in repentance), while the most perfect wording for blessings upon the Prophet ﷺ is the formula recited at the end of the tashahhud.”
I (the author) say: The remembrance just mentioned is what is commonly known as ‘the expiation of the gathering.’ Several hadiths have been reported on the subject; I shall quote one of them—the most complete version—which reads:
“Whoever says: ‘Subhān Allāh wa bi-ḥamdih, Subhānaka Allāhumma wa bi-ḥamdik, ash-hadu an lā ilāha illā Anta, astaghfiruka wa atūbu ilayk,’—if he utters it in a gathering of remembrance, it will serve as a seal set upon that gathering; and if he utters it in a gathering of frivolity, it will be an expiation for him.”
81 – “Whoever says: ‘Subhān Allāh wa bi-ḥamdih, Subhānaka Allāhumma wa bi-ḥamdik, ash-hadu an lā ilāha illā Anta, astaghfiruka wa atūbu ilayk’—if he says it in a gathering of remembrance, it will be like a seal stamped upon it; and if he says it in a frivolous gathering, it will atone for him.”
It was recorded by al-Ṭabarānī (1 / 79 / 2) and al-Ḥākim (1 / 537) through the route of Nāfiʿ ibn Jubayr ibn Muʿṭim, from his father, traced back to the Prophet. Al-Ḥākim said, “Authentic according to the criteria of Muslim,” and al-Dhahabī concurred—just as they both affirmed.
Al-Munadhirī (2 / 236) also attributed it to al-Nasāʾī and al-Ṭabarānī, remarking: “Their transmitters are the narrators of the Ṣaḥīḥ.”
Likewise, al-Haythamī (10 / 142 and 423) said: “It was narrated by al-Ṭabarānī, and its transmitters are the narrators of the Ṣaḥīḥ.”