After fleeing from their village, the people took refuge in the wilderness. After some days of travel, they later arrived at a fertile valley and they began to built new settlements there. But then, Allah sent two angels to them, one from the lower side and the other from the upper side of the valley. The angels screamed once, and all the people died instantly. Yes, they died at the same time, as if one man had died! Their bodies were later moved to a different place, where they were buried in graves, with a wall built around their cemetery. After a few years, their bodies rotted and disintegrated.
Many years later, one of the Prophets of Allah, Prophet Hazqiyal, peace be upon Him, passed by this cemetery on one of his travels. He saw the graves, and he asked Allah to bring the dead back to life by his hand. Allah accepted his supplication and commanded him to say, “O rotted bones, Allah commands you to come together.” The bones of every body were brought together into complete skeletons. Allah then commanded him to say, “O bones, Allah commands you to be covered with flesh, nerves and skin.” One by one, the skeletons of the people were covered by flesh, nerves and skin. Finally, Allah commanded His Prophet to say, “O souls, Allah commands you to return, each to the body that it used to inhabit!” After this, the souls returned to the bodies of the deceased people. They came back to life.
Upon their return to life, the people exclaimed, “All praise is due to You, O Allah, and there is no deity worthy of worship except You!” They had now learned their lesson that only Allah can take away their souls and running away from a plague would not prevent Him from doing so. Allah allowed them to rebuild their settlements, and they lived a very prosperous life after this. A few years later, Prophet Hazqiyal passed away in a nearby village, now known today as the village of Al-Kifl. He was buried there alongside some of the old scholars of Judaism, back when Judaism was the religion whom the rightly guided followed.
The story of the dead people is a reminder that no caution can ever avert destiny and that there is no refuge from Allah, but to Allah Himself. These people departed from their land fleeing the epidemic and seeking to enjoy a long life. But what they earned was the opposite of what they sought; Death came quickly and instantaneously. It immediately seized them all, leaving none of them a survivor. The fact that these people were brought to life, is in fact a clear proof that physical resurrection shall occur on the Day of Resurrection. This is why Allah said, “Truly, Allah is full of bounty to mankind but most men thank not.” (40:61) This means that Allah shows mankind His great signs, sound proofs and clear evidences. Yet, they do not thank Allah for what He has given them with in their worldly life and religious affairs.
Another lesson learnt from this story is what should be done in a plague. It was narrated from Saud that the Messenger of Allah ﷺ said, “If you hear of an outbreak of plague in a land, do not enter it; but if the plague breaks out in a place while you are in it, do not leave that place.” This Hadith was reported by Al-Bukhari in his Sahih (5728) and a similar narration is also present in Imam Ahmad ibn Hanbal's Musnad. We can learn that one should not enter a place where the plague is present, but at the same time, if one is already living in a place where plagues and epidemics is present, one should not leave their current living area either. And Allah knows best.
Sources
Holy Qur'an - Surah al-Baqarah
Ibn Kathir - Tafsir on Surah al-Baqarah (ayah 243)
Al-Tabari - Tarikh al-Rusul wa al-Muluk (volume 2, page 53-54)
Al-Thalabi - Ara'is al-Majalis