Weeping while passing the Graves of those who earned Allah’s wrath
Ibn Umar (radi Allahu anhu) reported: When the Messenger of Allah (sal Allahu alaihi wa sallam) and his Companions reached Al-Hijr, the dwellings of the people of Thamud, he admonished his Companions (saying), “Do not pass by these people who are being tormented, without weeping, lest the punishment should befall you as it had befallen them.”
[Sahih Al-Bukhari and Muslim]
In another similar narration is: Ibn Umar (radi Allahu anhu) said: When the Messenger of Allah (sal Allahu alaihi wa sallam) passed near Al-Hijr, he said, “Do not enter without weeping, the dwellings of those who wronged themselves, lest the same chastisement should fall upon you as it had fallen upon them.” The Messenger of Allah (sal Allahu alaihi wa sallam) then covered his head and sped up until he crossed the valley of the tormented people.
Thamud were the people to who Allah sent Prophet Salih (alaihi assalam). They lived between Al-Madinah and Syria. In 10 A.H. when the Prophet (sal Allahu alaihi wa sallam) went to the Syrian border for the expedition of Tabuk, he also passed through this ruined territory. This Hadith is related to the address which he gave to his Companions on the occasion.
Here is an instruction that when we happen to pass through the territory of a nation destroyed in the past as a result of Divine wrath, we are advised to quicken one’s pace. That is why we have been commanded to avoid the company of the corrupt and the wrongdoers, lest we meet their bad end, too.
Allah says (interpretation of the meaning): “And incline not toward those who do wrong, lest the Fire should touch you.” (11:113)
May Allah save us from it!
And Allah knows best!