It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) said: "When Allah Almighty intends to send punishment upon a people, then punishment descends upon all the inhabitants there; then they will be resurrected according to their deeds." (In the punishment, both the righteous and the wicked will be included; reward and punishment will be according to deeds.)