The Prophet ﷺ was sitting one day in public when Jibreel came to him and asked, "What is faith?"The Prophet ﷺ replied, "Faith is to believe in Allah, His angels, the meeting with Him, His messengers, and to believe in the resurrection."Jibreel asked, "What is Islam?"He answered, "Islam is to worship Allah without associating anything with Him, to establish the prayer, to pay the obligatory zakat, and to fast in Ramadan."Jibreel asked, "What is excellence?"He replied, "It is to worship Allah as though you see Him, for though you do not see Him, He surely sees you."Jibreel asked, "When is the Hour?"He answered, "The one questioned about it knows no more than the one asking, but I will tell you of its signs. When a slave woman gives birth to her mistress, and when barefoot, naked shepherds of camels compete in constructing tall buildings. It is among five things that none knows except Allah."Then the Prophet ﷺ recited, "Indeed, Allah has knowledge of the Hour, sends down the rain, and knows what is in the wombs. No soul knows what it will earn tomorrow, and no soul knows in which land it will die. Indeed, Allah is All-Knowing, All-Aware" [Luqman 31:34].Then the man turned to leave, and the Prophet ﷺ said, "Bring him back." But they saw no one. He said, "That was Jibreel. He came to teach the people their religion."
كان النبي ﷺ بارزا يوما للناس، فأتاه جبريل، فقال: ما الإيمان؟ قال: الإيمان أن تؤمن بالله وملائكته وبلقائه ورسله، وتؤمن بالبعث. قال: ما الإسلام؟ قال: الإسلام أن تعبد الله ولا تشرك به، وتقيم الصلاة، وتؤدي الزكاة المفروضة، وتصوم رمضان. قال: ما الإحسان؟ قال: أن تعبد الله كأنك تراه، فإن لم تكن تراه، فإنه يراك. قال: متى الساعة؟ قال: ما المسئول عنها بأعلم من السائل، وسأخبرك عن أشراطها: إذا ولدت الأمة ربها، وإذا تطاول رعاة الإبل البهم في البنيان، في خمس لا يعلمهن إلا الله. ثم تلا النبي ﷺ: {إن الله عنده علم الساعة وينزل الغيث ويعلم ما في الأرحام وما تدري نفس ماذا تكسب غدا وما تدري نفس بأي أرض تموت إن الله عليم خبير}[لقمان: ٣٤] الآية. ثم أدبر، فقال: ردوه. فلم يروا شيئا. فقال: هذا جبريل، جاء يعلم الناس دينهم.
Bukhari related it in the Book of Faith (50), and Muslim in the Book of Faith (9), both from the hadith of Ismail bin Ibrahim bin Ulayyah, who said, our teacher Abu Hayan Taymi informed us, from Abu Zura, from Abu Hurairah, and he narrated it. Their wording is identical.