"that there is no refuge from Allah except in Him." It has reached us that the Messenger of Allah (peace be upon him) had commanded the people neither to speak to them nor to sit with them. Then, he sent word to their families not to harbor them and not to speak to them. When they saw that, they felt remorse and came to the pillars of the mosque, where they bound themselves, until Allah—Exalted and Majestic is He—revealed their repentance in this verse.
﴿أَنْ لَا مَلْجَأَ مِنَ اللَّهِ إِلَّا إِلَيْهِ﴾ بَلَغَنَا أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ أَمَرَ النَّاسَ أَلا يُكَلِّمُوهُمْ وَلا يُجَالِسُوهُمْ، ثُمَّ أَرْسَلَ إِلَى أَهْلِيهِمْ أَلا يؤوهم وَلا يُكَلِّمُوهُمْ؛ فَلَمَّا رَأَوْا ذَلِكَ نَدِمُوا وَجَاءُوا إِلَى سَوَارِي الْمَسْجِدِ، فَأَوْثَقُوا أَنْفُسَهُمْ؛ حَتَّى أَنْزَلَ اللَّهُ ﷿ تَوْبَتَهُمْ فِي هَذِهِ الْآيَة.