Quran 18:87 — The Cave (Al-Kahf)
He said, "As for those who transgress, we will punish them, then, when they return to their Lord, He will commit them to more retribution.
[18:86] When he reached the far west, he found the sun setting in a vast ocean, and found people there. We said, "O Zul-Qarnain, you can rule as you wish; either punish, or be kind to them."
[18:88] "As for those who believe and lead a righteous life, they receive a good reward; we will treat them kindly."