The generality of the message of the Prophet to all mankind and jinn
Did Allah send a messenger to the Jinn (creatures created from fire) before Prophet Muhammad (peace be upon him); were they created before humans; and what are their laws?
Allah has sent Muhammad (peace be upon him) to all human beings and the Jinn. Allah (Exalted be He) says:
And We have not sent you (O Muhammad صلى الله عليه وسلم) except as a giver of glad tidings and a warner to all mankind
Say (O Muhammad صلى الله عليه وسلم): "What thing is the most great in witness?" Say: "Allâh (the Most Great!) is Witness between me and you; this Qur’ân has been revealed to me that I may therewith warn you and whomsoever it may reach.
And (remember) when We sent towards you (Muhammad صلى الله عليه وسلم) a group (three to ten persons) of the jinn, (quietly) listening to the Qur’ân. When they stood in the presence thereof, they said: "Listen in silence!" And when it was finished, they returned to their people, as warners.
They said: "O our people! Verily, we have heard a Book (this Qur’ân) sent down after Mûsâ (Moses), confirming what came before it: it guides to the truth and to the Straight Path (i.e. Islâm).
O our people! Respond (with obedience) to Allâh’s Caller (i.e. Allâh’s Messenger Muhammad صلى الله عليه وسلم), and believe in him (i.e. believe in that which Muhammad صلى الله عليه وسلم has brought from Allâh and follow him). He (Allâh) will forgive you of your sins, and will save you from a painful torment (i.e. Hell-fire)
And whosoever does not respond to Allâh’s Caller, he cannot escape on earth, and there will be no Auliyâ’ (lords, helpers, supporters, protectors) for him besides Allâh (from Allâh’s punishment). Those are in manifest error.
(Part No. 3; Page No. 371) Allah (Exalted be He) also says:
Say (O Muhammad صلى الله عليه وسلم): "It has been revealed to me that a group (from three to ten in number) of jinn listened (to this Qur’ân). They said: ‘Verily, we have heard a wonderful Recitation (this Qur’ân)!
‘It guides to the Right Path, and we have believed therein, and we shall never join (in worship) anything with our Lord (Allâh).
All these Ayahs (Qur'anic verses) and others of the same meaning show that the message of the Prophet (peace be upon him) is general, for all humans and the Jinn, and that the laws that apply to the Jinn is the Islamic Shari`ah (Islamic laws). As to whether they were created before mankind or after them, it has no effect in relation to their obligations under the Shari`ah. We do not know whether a messenger was sent to them before Prophet Muhammad (peace be upon him).May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.