The Prophet ﷺ set out with a group of his companions heading for the market of Ukaz. Now the devils had been barred from the tidings of heaven and shooting stars had been sent against them, so they returned to their people, who asked, "What is wrong with you?"They said, "We have been barred from the tidings of heaven, and shooting stars have been hurled at us."Their people said, "Nothing has barred you from the tidings of heaven except some event that has occurred. So travel through the east and the west of the earth and find out what it is that has come between you and the tidings of heaven."Those who set out toward Tihamah came upon the Prophet ﷺ at Nakhlah, while he was on his way to the market of Ukaz and was leading his companions in the Fajr prayer. When they heard the Quran, they listened closely to it and said, "By Allah, this is what has come between you and the tidings of heaven."At that point they went back 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].So Allah revealed to His Prophet ﷺ, "Say, it has been revealed to me" [Jinn 72:1], and what was revealed to him was the speech of the jinn.
انطلق النبي ﷺ في طائفة من أصحابه عامدين إلى سوق عكاظ، وقد حيل بين الشياطين وبين خبر السماء وأرسلت عليهم الشهب، فرجعت الشياطين إلى قومهم فقالوا: مالكم؟ فقالوا: حيل بيننا وبين خبر السماء وأرسلت علينا الشهب! قالوا: ما حال بينكم وبين خبر السماء إلا شيء حدث، فاضربوا مشارق الأرض ومغاربها فانظروا ما هذا الذي حال بينكم وبين خبر السماء، فانصرف أولئك الذين توجهوا نحو تهامة إلى النبي ﷺ، وهو بنخلة عامدين إلى سوق عكاظ وهو يصلي بأصحابه صلاة الفجر، فلما سمعوا القرآن استمعوا له فقالوا: هذا والله الذي حال بينكم وبين خبر السماء فهنالك حين رجعوا إلى قومهم، فقالوا: يا قومنا {إنا سمعنا قرءانا عجبا يهدي إلى الرشد فآمنا به ولن نشرك بربنا أحدا} [سورة الجن ١- ٢]. فأنزل الله على نبيه ﷺ {قل أوحى إلى} وإنما أوحي إليه قول الجن.
Bukhari narrated it in the Book of Prayer (773), and Muslim in the Book of Prayer (449), both from the hadith of Abu Awana, from Abu Bishr, from Saeed bin Jubayr, from Ibn Abbas, and he mentioned it. The wording given is that of Bukhari, and the wording of Muslim is close to it.