Volume 9 · Book 88 · Hadith 224
Narrated Ibn 'Umar: Allah's Apostle 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. "
— Sahih Bukhari, Volume 9, Book 88: Afflictions and the End of the World, Hadith #224