It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) said: "Do not pass by those peoples who were punished, unless you pass by weeping. If you do not weep, do not pass by their settlements, lest the punishment that struck them should strike you."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4367