I was walking with the Prophet ﷺ among the ruins of Madinah, and he was leaning on a palm branch he had with him, when we passed by a group of Jews.Some of them said to one another, "Ask him about the spirit."Others said, "Do not ask him, or he may say something about it that you will not like."But some insisted, "We will certainly ask him."So one of them stood up and said, "Abu Qasim, what is the spirit?"The Prophet ﷺ remained silent, and I said to myself, "He is receiving revelation." So I stood up, and when the state passed from him, he recited, "And they ask you about the spirit. Say, the spirit is from the affair of my Lord, and you have not been given of knowledge except a little" [Isra 17:85].
بينا أنا أمشي مع النبي ﷺ في خرب المدينة- وهو يتوكأ على عسيب معه- فمر بنفر من اليهود، فقال بعضهم لبعض: سلوه عن الروح، وقال بعضهم: لا تسألوه لا يجيء فيه بشيء تكرهونه، فقال بعضهم: لنسألنه، فقام رجل منهم فقال: يا أبا القاسم، ما الروح؟ فسكت. فقلت: إنه يوحى إليه، فقمت فلما انجلى عنه، فقال: {ويسألونك عن الروح قل الروح من أمر ربي وما أوتيتم من العلم إلا قليلا} [سورة الإسراء: ٨٥].
Bukhari narrated it in the Book of Knowledge (125), and Muslim in the Book of the Characteristics of the Hypocrites (2794), both from the hadith of Amash, from Ibrahim, from Alqama, from Abdullah, who then related the hadith.