Quran 7:168 from Surah Al-A'raaf on Divine Marvels.
وَقَطَّعۡنَٰهُمۡ فِي ٱلۡأَرۡضِ أُمَمٗاۖ مِّنۡهُمُ ٱلصَّٰلِحُونَ وَمِنۡهُمۡ دُونَ ذَٰلِكَۖ وَبَلَوۡنَٰهُم بِٱلۡحَسَنَٰتِ وَٱلسَّيِّـَٔاتِ لَعَلَّهُمۡ يَرۡجِعُونَ
English translation: And We divided them in the earth (as) nations Among them (are) the righteous and among them (are) other than that And We tested them with the good and the bad so that they may return
Transliteration: waqatta'nahum fi al-ardi umaman min'humu al-salihuna wamin'hum duna dhalika wabalawnahum bil-hasanati wal-sayiati la'allahum yarji'una