Read Surah At-Tawba 9:118: "And [He turned in His mercy, too,] towards the three [groups of believers] who had fallen prey to corruption, until in t..." Full Arabic text, English translation, and image generator.
وَعَلَى الثَّلَاثَةِ الَّذِينَ خُلِّفُوا حَتَّىٰ إِذَا ضَاقَتْ عَلَيْهِمُ الْأَرْضُ بِمَا رَحُبَتْ وَضَاقَتْ عَلَيْهِمْ أَنْفُسُهُمْ وَظَنُّوا أَنْ لَا مَلْجَأَ مِنَ اللَّهِ إِلَّا إِلَيْهِ ثُمَّ تَابَ عَلَيْهِمْ لِيَتُوبُوا ۚ إِنَّ اللَّهَ هُوَ التَّوَّابُ الرَّحِيمُ
And [He turned in His mercy, too,] towards the three [groups of believers] who had fallen prey to corruption, until in the end-after the earth, despite all its vastness, had become [too] narrow for them and their souls had become [utterly] constricted they came to know with certainty that there is no refuge from God other than [a return] unto Him; and thereupon He turned again unto them in His mercy, so that they might repent: for, verily, God alone is an acceptor of repentance, a dispenser of grace.