Meaning and benefit
The dua trains the heart to see the masjid as a place of mercy, refuge, and guidance rather than just a building or social hall.
Background
Authentic narrations describe the Prophet ﷺ teaching a dua when entering the masjid, asking for Allah’s mercy and greeting the Prophet ﷺ with salām. preciousgemsfromthequranand.wordpress Entering the mosque is treated as a dignified act: the believer seeks mercy, recognizes the sanctity of the place, and connects with the prophetic before beginning worship.
When to recite
Recite when entering the mosque.
Source note
Classification: Sahih
The concise wording for entering the mosque is reported in Sahih Muslim. Longer versions are also reported in some collections. The entering-mosque dua asks Allah for mercy, while the leaving-mosque dua asks Allah for bounty.