The Prophet ﷺ passed by him while he was praying and called him. He said, "I finished my prayer, then came to him."The Prophet ﷺ asked, "What prevented you from responding to me?"He replied, "I was praying."The Prophet ﷺ said, "Did Allah not say, 'O you who believe, respond to Allah and to the Messenger when he calls you to that which gives you life' [Anfal 8:24]? I will surely teach you the greatest surah of the Quran" — or "in the Quran," Khalid was uncertain — "before I leave the mosque."He said, "I asked, 'Messenger of Allah, what about your statement?'"The Prophet ﷺ said, "'Praise be to Allah, Lord of the worlds' [Fatihah 1:2]. It is the seven oft-repeated verses that I have been given, and the Magnificent Quran."
حدثنا عبيد الله بن معاذ حدثنا خالد حدثنا شعبة عن خبيب بن عبد الرحمن قال سمعت حفص بن عاصم يحدث
ى أن النبي ﷺ مر به وهو يصلي فدعاه قال فصليت ثم أتيته قال فقال ما منعك أن تجيبني قال كنت أصلي قال ألم يقل الله عز وجل {يا أيها الذين آمنوا استجيبوا لله وللرسول إذا دعاكم لما يحييكم} لأعلمنك أعظم سورة من القرآن أو في القرآن شك خالد قبل أن أخرج من المسجد قال قلت يا رسول الله قولك قال الحمد لله رب العالمين هي السبع المثاني التي أوتيت والقرآن العظيم
Bukhari narrated it in the tafsir chapter, in the section on what has been said concerning the Fatihah of the Book, no. 4474, from the hadith of Shubah, through the same chain.