The Messenger of Allah ﷺ said, "On the Day of Resurrection, Allah will gather the people, and they will say, 'If only we sought someone to intercede for us with our Lord, so that He may relieve us from where we are.'So they will come to Adam and say, 'You are the one whom Allah created with His own hand, breathed into you of His spirit, and commanded the angels to prostrate to you. Intercede for us with our Lord.'He will say, 'I am not the one for that,' and he will mention his sin. He will say, 'Go to Nuh, the first messenger Allah sent.'So they will come to him, and he will say, 'I am not the one for that,' and he will mention his sin. 'Go to Ibrahim, whom Allah took as a close friend.'So they will come to him, and he will say, 'I am not the one for that,' and he will mention his sin. 'Go to Musa, to whom Allah spoke directly.'So they will come to him, and he will say, 'I am not the one for that,' and he will mention his sin. 'Go to Isa.'So they will come to him, and he will say, 'I am not the one for that. Go to Muhammad ﷺ, for his earlier and later sins have been forgiven.'So they will come to me, and I will seek permission to approach my Lord. When I see Him, I will fall in prostration. He will leave me as long as He wills, then it will be said, 'Raise your head. Ask, and you shall be given. Speak, and you shall be heard. Intercede, and your intercession shall be accepted.'So I will raise my head and praise my Lord with words of praise He will teach me. Then I will intercede, and a limit will be set for me. Then I will bring them out of the Fire and admit them into Paradise. Then I will return and fall in prostration as before, a third or fourth time, until none remain in the Fire except those whom the Quran has detained."When reaching this point, Qatada used to say, "Meaning, those upon whom eternity in the Fire has been decreed."
قال رسول الله ﷺ: يجمع الله الناس يوم القيامة، فيقولون: لو استشفعنا على ربنا حتى يريحنا من مكاننا، فيأتون آدم فيقولون: أنت الذي خلقك الله بيده، ونفخ فيك من روحه، وأمر الملائكة فسجدوا لك، فاشفع لنا عند ربنا. فيقول: لست هناكم، ويذكر خطيئته، ويقول: ائتوا نوحا، أول رسول بعثه الله، فيأتونه فيقول: لست هناكم، ويذكر خطيئته، ائتوا إبراهيم الذي اتخذه الله خليلا، فيأتونه فيقول: لست هناكم، ويذكر خطيئته، ائتوا موسى الذي كلمه الله، فيأتونه فيقول: لست هناكم، فيذكر خطيئته، ائتوا عيسى فيأتونه، فيقول: لست هناكم، ائتوا محمدا ﷺ، فقد غفر له ما تقدم من ذنبه وما تأخر، فيأتوني، فأستأذن على ربي، فإذا رأيته وقعت ساجدا، فيدعني ما شاء الله، ثم يقال: ارفع رأسك: سل تعطه، وقل يسمع، واشفع تشفع، فأرفع رأسي، فأحمد ربي بتحميد يعلمني، ثم أشفع فيحد لي حدا، ثم أخرجهم من النار، وأدخلهم الجنة، ثم أعود فأقع ساجدا مثله في الثالثة، أو الرابعة، حتى ما بقي في النار إلا من حبسه القرآن. وكان قتادة، يقول عند هذا: أي وجب عليه الخلود.
Bukhari related it in the Book of Softening of Hearts (6565), and Muslim in the Book of Faith (193:322), both through the route of Abu Awana, from Qatada, from Anas, and he mentioned it. The wording given is Bukhari's.The hadith of intercession was related by Bukhari in several places, including in the Book of Monotheism (7440) as a suspended narration, where he said, Hajjaj bin Minhal said, Hammam bin Yahya narrated to us, Qatada narrated to us, from Anas, that the Prophet ﷺ said, and he mentioned the hadith in full. In it appears the phrase, "so I seek permission to enter my Lord's abode, and I am given permission." He mentioned "his abode" in this hadith three times. Mentioning "the abode" in it is an anomaly, which no one else corroborated, unless what is meant by "his abode" is a place beneath the Throne.