The Prophet Muhammad (saas) Was Also the Prophet of the Jinn
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)
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)
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)
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.
They will not help you in any way against Allah.
The wrongdoers are protectors of one another
but Allah is the Protector of those who do their duty.
(Surat al-Jathiyya: 19)