Before the Prophethood of the Prophet (peace be upon him) the jinn used to collect news from the sky. Since the Prophethood of the Prophet (peace and blessings of Allaah be upon him), the jinn have been barred from gathering news from the heavens. According to him, if any of them went upstairs to hear the news, he would be expelled by throwing meteorites. The jinns tried to unravel the cause of this new situation and their various groups spread to different parts of the world in search of the cause. A group also reached Hijaz. On that day, the Prophet (peace and blessings of Allaah be upon him) was staying with some of his Companions at a place called Batne Nakhla.
They wanted to go to Okay market. In those days the Arabs used to organize fairs on special days in different places like the exhibitions of our time. Many people attended these fairs, shops were opened and meetings were held. One such fair was held every year at a place called Okay. The Prophet (peace and blessings of Allaah be upon him) probably went there to spread Islam. He was reciting the Qur'an in the Fajr prayers at a place called Nakhla. Then Jean's investigative team arrived. They listened to the Qur'an and said, "This is a new phenomenon that has prevented us from gathering news from the sky."
According to another account, the jinn reached there and said to each other, "Listen quietly." When the Prophet (peace and blessings of Allaah be upon him) finished the prayer, the jinn returned to their community believing in the truth of Islam and reporting the investigation, saying, "We have become Muslims."
You should also accept Islam. But the Prophet (peace and blessings of Allaah be upon him) did not know anything about the conversion of these jinn and their conversion to Islam until Surah Jinn was revealed. In Surah Jinn, Allah informed him about this.
According to another account, the number of these jinns living in a place called Nasibain was nine or seven. As a result of their preaching, three hundred more jinn later came to the Prophet (peace and blessings of Allaah be upon him) to convert to Islam.