Sahih al-Bukhari #4715 · Prophetic Commentary on the Qur'an (Tafseer of the Prophet (pbuh))

Sahih al-BukhariAbdullah ibn Masud
Sahih al-Bukhari · Book 65 · Prophetic Commentary on the Qur'an (Tafseer of the Prophet (pbuh))
Sahih al-Bukhari · كتاب 65 · كتاب التفسير
Regarding the Verse: 'Those whom they call upon (worship) (like Jesus the Son of Mary or angels etc.) desire (for themselves) means of access, to their Lord....' (17.57) (It was revealed regarding) some Jinns who used to be worshipped (by human beings). They later embraced Islam (while those people kept on worshipping them)
حَدَّثَنَا بِشْرُ بْنُ خَالِدٍ، أَخْبَرَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، عَنْ شُعْبَةَ، عَنْ سُلَيْمَانَ، عَنْ إِبْرَاهِيمَ، عَنْ أَبِي مَعْمَرٍ، عَنْ عَبْدِ اللَّهِ ـ رضى الله
عنه ـ فِي هَذِهِ الآيَةِ ‏{‏الَّذِينَ يَدْعُونَ يَبْتَغُونَ إِلَى رَبِّهِمِ الْوَسِيلَةَ‏}‏ قَالَ نَاسٌ مِنَ الْجِنِّ ‏{‏كَانُوا‏}‏ يُعْبَدُونَ فَأَسْلَمُوا‏.‏
Reference : Sahih al-Bukhari 4715In-book reference : Book 65, Hadith 237