Sahih Muslim Book 043, Hadith Number 7182.
Chapter : Pertaining to the Words of Allah: "Those whom they call upon, themselves seek the means of access to their Lord" (xvii. 57).
Abdullah b. Mas'ud reported in connection with the words of Allah, the Exalted and Glorious: "Those to whom they call upon, themselves seek the means or access to their Lord as to whoever of them becomes nearest" (xvii. 57) that it related to a party of Jinn who were being worshipped and they embraced Islam but those who worshipped them kept on worshipping them (though the Jinn whom the misguided people worshipped had become Muslims). It was then that this verse was revealed.