Sahih al-Bukhari, Hadith 7108

Narrated Ibn `Umar: Allah's Messenger said, "If Allah sends punishment upon a nation then it befalls upon the whole population indiscriminately and then they will be resurrected (and judged) according to their deeds. "

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ عُثْمَانَ، أَخْبَرَنَا عَبْدُ اللَّهِ، أَخْبَرَنَا يُونُسُ، عَنِ الزُّهْرِيِّ، أَخْبَرَنِي حَمْزَةُ بْنُ عَبْدِ اللَّهِ بْنِ عُمَرَ، أَنَّهُ سَمِعَ ابْنَ عُمَرَ ـ رضى الله عنهما ـ يَقُولُ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِذَا أَنْزَلَ اللَّهُ بِقَوْمٍ عَذَابًا، أَصَابَ الْعَذَابُ مَنْ كَانَ فِيهِمْ، ثُمَّ بُعِثُوا عَلَى أَعْمَالِهِمْ ‏" ‏‏.‏

sunnah.com