in the 72nd sura of the qur'an, surat al-jinn, allah reveals that the jinn too listened to the communications of the prophet muhammad (saas) and the qur'an, and that some of them were bound to the prophet (saas) as muslims. one verse on the subject reads:
say: "it has been revealed to me that a band of the jinn listened and said, 'we have heard a most amazing recitation. it leads to right guidance so we believe in it and will not associate anyone with our lord.'" (surat al-jinn: 1-2)
in that same sura, allah also reveals that some jinn are actually muslims:
[the jinn said]: "and when we heard the guidance, we believed in it. anyone who believes in his lord need fear neither belittlement nor tyranny. some of us are muslims and some are deviators. those who have become muslim are those who sought right guidance." (surat al-jinn: 13-14)
these jinn state that some among them opposed allah by telling lies and inventing superstitions. that superstitious religion that the jinn had believed in is also described in that sura:
he-exalted be the majesty of our lord!-has neither wife nor son. the fools among us have uttered a vile slander against allah. we did not think it possible for either man or jinn to tell a lie against allah. (surat al-jinn: 3-5)
yet another verse recounts that when the prophet (saas) rose for his religious obligations, the jinn would gather around him:
when the servant of allah stands calling on him, they almost swarm all over him. (surat al-jinn: 19)
and remind them, for truly the believers benefit from being reminded. i only created jinn and man to worship me.
(surat ahd-dhariyat: 55-56)
as that verse makes clear, the prophet muhammad (saas) was sent as a prophet for all men and the jinn. the qur'an is a guide for both mankind and the jinn.
you who believe! respond to allah and to the messenger when he calls you to what will bring you to life! know that allah intervenes between a man and his heart and that you will be gathered to him.
(surat al-anfal: 24)
you who believe! heed allah and believe in his messenger. he will give you a double portion of his mercy and grant you a light by which to walk and forgive you…
(surat al-hadid: 28)