Al Qasas Ayah 59
وَمَا كَانَ رَبُّكَ مُهْلِكَ ٱلْقُرَىٰ حَتَّىٰ يَبْعَثَ فِىٓ أُمِّهَا رَسُولاً يَتْلُواْ عَلَيْهِمْ ءَايَـٰتِنَاۚ وَمَا كُنَّا مُهْلِكِى ٱلْقُرَىٰٓ إِلَّا وَأَهْلُهَا ظَـٰلِمُونَ ٥٩
Your Lord would never destroy a society until He had sent to its capital a messenger, reciting Our revelations to them. Nor would We ever destroy a society unless its people persisted in wrongdoing.