Quran 7:168 — The Purgatory (Al-A'araf)
We scattered them among many communities throughout the land. Some of them were righteous, and some were less than righteous. We tested them with prosperity and hardship, that they may return.
[7:167] Additionally, your Lord has decreed that He will raise up against them people who will inflict severe persecution upon them, until the Day of Resurrection. Your Lord is most efficient in enforcing retribution, and He is certainly the Forgiver, Most Merciful.
[7:169] Subsequent to them, He substituted new generations who inherited the scripture. But they opted for the worldly life instead, saying, "We will be forgiven." But then they continued to opt for the materials of this world. Did they not make a covenant to uphold the scripture, and not to say about GOD except the truth? Did they not study the scripture? Certainly, the abode of the Hereafter is far better for those who maintain righteousness. Do you not understand?