The Messenger of Allah ﷺ set out with a group of his companions heading for the market of Ukaz. By then the devils had been barred from the news of heaven, and shooting stars were being sent against them. So the devils returned to their own, who asked them,"What is wrong with you?"They replied, "We have been barred from the news of heaven, and shooting stars have been sent against us."Their leader said, "Nothing has come between you and the news of heaven except some event that has occurred. So travel through the east and west of the earth and find out what this thing is that has happened."So they set out and travelled through the east and west of the earth, searching for what it was that had come between them and the news of heaven.Those who had turned toward Tihamah came upon the Messenger of Allah ﷺ at Nakhlah, as he was on his way to the market of Ukaz, leading his companions in the Fajr prayer. When they heard the Quran they listened closely to it and said, "This is what has come between you and the news of heaven."At that point they returned to their people and said, "Our people, 'we have heard a wondrous recitation that guides to what is right, so we have believed in it, and we will never associate anyone with our Lord'" [Jinn 72:1–2].And Allah revealed to His Prophet ﷺ, "Say, it has been revealed to me that a company of the jinn listened" [Jinn 72:1]. What was revealed to him was the speech of the jinn.
انطلق رسول الله ﷺ في طائفة من أصحابه عامدين إلى سوق عكاظ، وقد حيل بين الشياطين وبين خبرالسماء، وأرسلت عليهم الشهب، فرجعت الشياطين، فقالوا: ما لكم؟ فقالوا: حيل بيننا وبين خبر السماء، وأرسلت علينا الشهب. قال: ما حال بينكم وبين خبر السماء إلا ما حدث، فاضربوا مشارق الأرض ومغاربها، فانظروا ما هذا الأمر الذي حدث فانطلقوا، فضربوا مشارق الأرض ومغاربها، ينظرون ما هذا الأمر الذي حال بينهم وبين خبر السماء. قال: فانطلق الذين توجهوا نحو تهامة إلى رسول الله ﷺ بنخلة، وهو عامد إلى سوق عكاظ، وهو يصلي بأصحابه صلاة الفجر، فلما سمعوا القرآن تسمعوا له، فقالوا: هذا الذي حال بينكم وبين خبر السماء، فهنالك رجعوا إلى قومهم، فقالوا: يا قومنا: {إنا سمعنا قرءانا عجبا يهدى إلى الرشد فءامنا به ولن نشرك بربنا أحدا} وأنزل الله عز وجل على نبيه ﷺ: {قل أوحي إلي أنه استمع نفر من الجن} وإنما أوحي إليه قول الجن.
Bukhari narrated it in the tafsir (4921) and Muslim in the prayer chapter (449), both through Abu Awana, from Abu Bishr, from Saeed bin Jubayr, from Ibn Abbas, who said, and then he related it. The wording given is Bukhari's, and Muslim's wording is similar.It appears that this surah was revealed in the tenth year after the beginning of the mission. The apparent meaning of the hadith is that they believed in the Prophet ﷺ after hearing the Quran, and then returned to their people calling them to Islam. At the beginning of the hadith in Sahih Muslim, Abdullah bin Abbas says that the Messenger of Allah ﷺ did not recite to the jinn nor did he see them, referring to this story in which the Messenger of Allah ﷺ performed the dawn prayer.As for the hadith of Ibn Masud from the Prophet ﷺ, that a caller of the jinn came to him, so he went with him and recited the Quran to them, that is a different story, as has come in the Sahih.