“When Allah intends punishment for a people, the punishment afflicts those who are among them, and then they are resurrected according to their deeds.”
Reported by al-Bukhārī (no. 7108) and Muslim (no. 2879), from the narration of Ibn ʿUmar — may Allah be pleased with them both.
Brief Explanation of the Hadith
In this hadith, the Prophet — may Allah’s peace and blessings be upon him — informs that when punishment descends upon a people, it strikes all of them, both the righteous and the wicked—out of justice from Him, Exalted is He—due to the spread of corruption, the prevalence of sins, and people’s silence in the face of evil. This is as in the hadith of Zaynab — may Allah be pleased with her — when she asked the Prophet — may Allah’s peace and blessings be upon him: “Will we perish while among us are the righteous?” He replied: “Yes, if wickedness becomes prevalent.”
Then, from Allah’s mercy to the people of righteousness and goodness is that they will be resurrected on the Day of Judgment according to their righteous deeds, and each will be recompensed for what he sent forth of good or evil: the righteous will be resurrected upon their righteousness and thus honored, while the wicked will be resurrected upon their wickedness and thus disgraced.
Nor should the destruction of the righteous be objected to, for their righteous deeds will be rewarded in the Hereafter, while whatever afflicts them in this world of hardship serves as expiation for their sins and elevation of their ranks.
The hadith also encourages distancing oneself from the people of oppression and avoiding rebels and the immoral, as a means of protecting society from corruption—which is among the greatest causes of an evil end.
The hadith also teaches that sharing in a calamity does not mean equality in recompense; rather, each person will be resurrected according to his intention and rewarded for his deed.
It further shows that punishment is a purification for the believers and a retribution upon the defiantly disobedient.