Sahih Muslim 193 e
Ma'bad b. Hilal al 'Anazi reported:
We went to Anas b. Malik through Thabit and reached there (his house) while he was offering the forenoon prayer. Thabit sought permission for us and we entered, and he seated Thabit with him on his bedstead. He (Thabit) said to him (Anas b. Malik): O Abu Hamza (kunya of Anas b. Malik), your brothers from among the inhabitants of Basra ask you to narrate to them the hadith of intercession. He said: Muhammad (ﷺ) narrated to us: When it would be the Day of Resurrection, some of the people would rush to one another in bewilderment. They would come to Adam and say: Intercede (with your Lord) for your progeny. He would say: I am not fit to do this, but go to Ibrahim (peace be upon him) for he is the Friend of Allah. They would come to Ibrahim, but he would say: I am not fit to do this, but go to Moses, for he is Allah's Interlocutor. They would come to Moses, but he would say: I am not fit to do this, but you should go to Jesus, for he is the Spirit of Allah and His word. They would come to Jesus, and he would say, I am not fit to do this; you better go to Muhammad (ﷺ). They would come to me, and I would say: I am in a position to do that, I would go and ask the permission of my Lord and it would be granted to me. I would then stand before Him and would extol Him with praises which I am not able to do now, but with which Allah would inspire me, then I would fall in prostration and it would be said to me: O Muhammad, raise thy head, and say and it would be listened to; ask and it would be granted, intercede and it would be accepted. I shall say: My Lord, my people, my people It would be said: Go, and bring forth from it (Hell) him who has in his heart faith equal to the weight of a wheat grain or a barley seed. I would go and do that; then I would return to my Lord and extol Him with those praises (taught to me by Allah), then I would fall in prostration. It would be said to me: O Muhammad, raise your head, and say and it would be heard; ask and it would be granted; intercede and intercession would be accepted. So I would say: My people. my people. It would be said to me: Go and take out from it (Hell) him who has in his heart faith equal to the weight of a mustard seed. I would go and do that. I would again return to my Lord and extol Him with those praises. I would then fall in prostration. It would be said to me: O Muhammad, raise your head: say, and you would be listened to; ask and it would be granted; intercede and intercession would be accepted. I would say: My Lord, my people, my people. It would be said to me: Go, and bring out of the Fire him who has in his heart as much faith as the smallest, smallest, smallest grain of mustard seed. I would go and do that. 
This is the hadith which Anas narrated to us. We went out of his (house) and when we reached the upper part of Jabban (graveyard) we said: Would that we meet Hasan and salute him and he was hiding in the house of Abu Khalifa. He (Ma'bad b. Hilal, the narrator) said: We went to him and greeted him and we said: O Abu Sa'id, we come from your brother Abu Hamza (kunya of Anas), and we have never heard a hadith like this relating to intercession, which he has narrated to us. He said: Narrate it, we narrated the hadith. He said: Narrate it (still further). We said: He did not (narrate it) before us more than this. He said: He (Anas) had narrated it to us twenty years back, when he was strong and healthy. He has in fact missed something. I cannot make out whether the old man has forgotten or he has (intentionally) avoided to narrate it to you lest you should rely (absolutely) upon it (and abandon doing good deeds). We said to him: Relate that to us, and he laughed and said: There is haste in the nature of man. I did not make mention of it to you but for the fact that I wanted to narrate that to you (and added that the Prophet said): I would then return to my Lord for the fourth time and extol Him with these praises. I would then fall in prostration. It would be said to me: O Muhammad, raise your head: say and it will be listened to; ask and it will be granted; intercede and intercession would be accepted. I would say: O my Lord, permit me regarding him who professed: There is no god but Allah. He (the Lord) would say: That is not for thee or that is not what lies with thee, but by My Honour, Glory, Greatness and Might, I would certainly take him out who professed it: There is no god but Allah. He (the narrator, Ma'bad) said: I hear testimony to the fact that the hadith transmitted to us-by Hasan was heard by him from Anas b. Malik and I can see that he reported it twenty years back, when he was hale and hearty.
حَدَّثَنَا أَبُو الرَّبِيعِ الْعَتَكِيُّ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، حَدَّثَنَا مَعْبَدُ بْنُ هِلاَلٍ الْعَنَزِيُّ، ح وَحَدَّثَنَاهُ سَعِيدُ بْنُ مَنْصُورٍ، - وَاللَّفْظُ لَهُ - حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، حَدَّثَنَا مَعْبَدُ بْنُ هِلاَلٍ الْعَنَزِيُّ، قَالَ انْطَلَقْنَا إِلَى أَنَسِ بْنِ مَالِكٍ وَتَشَفَّعْنَا بِثَابِتٍ فَانْتَهَيْنَا إِلَيْهِ وَهُوَ يُصَلِّي الضُّحَى فَاسْتَأْذَنَ لَنَا ثَابِتٌ فَدَخَلْنَا عَلَيْهِ وَأَجْلَسَ ثَابِتًا مَعَهُ عَلَى سَرِيرِهِ فَقَالَ لَهُ يَا أَبَا حَمْزَةَ إِنَّ إِخْوَانَكَ مِنْ أَهْلِ الْبَصْرَةِ يَسْأَلُونَكَ أَنْ تُحَدِّثَهُمْ حَدِيثَ الشَّفَاعَةِ ‏.‏ قَالَ حَدَّثَنَا مُحَمَّدٌ صلى الله عليه وسلم قَالَ ‏"‏ إِذَا كَانَ يَوْمُ الْقِيَامَةِ مَاجَ النَّاسُ بَعْضُهُمْ إِلَى بَعْضٍ فَيَأْتُونَ آدَمَ فَيَقُولُونَ لَهُ اشْفَعْ لِذُرِّيَّتِكَ ‏.‏ فَيَقُولُ لَسْتُ لَهَا وَلَكِنْ عَلَيْكُمْ بِإِبْرَاهِيمَ - عَلَيْهِ السَّلاَمُ - فَإِنَّهُ خَلِيلُ اللَّهِ ‏.‏ فَيَأْتُونَ إِبْرَاهِيمَ فَيَقُولُ لَسْتُ لَهَا وَلَكِنْ عَلَيْكُمْ بِمُوسَى - عَلَيْهِ السَّلاَمُ - فَإِنَّهُ كَلِيمُ اللَّهِ ‏.‏ فَيُؤْتَى مُوسَى فَيَقُولُ لَسْتُ لَهَا وَلَكِنْ عَلَيْكُمْ بِعِيسَى - عَلَيْهِ السَّلاَمُ - فَإِنَّهُ رُوحُ اللَّهِ وَكَلِمَتُهُ ‏.‏ فَيُؤْتَى عِيسَى فَيَقُولُ لَسْتُ لَهَا وَلَكِنْ عَلَيْكُمْ بِمُحَمَّدٍ صلى الله عليه وسلم فَأُوتَى فَأَقُولُ أَنَا لَهَا ‏.‏ فَأَنْطَلِقُ فَأَسْتَأْذِنُ عَلَى رَبِّي فَيُؤْذَنُ لِي فَأَقُومُ بَيْنَ يَدَيْهِ فَأَحْمَدُهُ بِمَحَامِدَ لاَ أَقْدِرُ عَلَيْهِ الآنَ يُلْهِمُنِيهِ اللَّهُ ثُمَّ أَخِرُّ لَهُ سَاجِدًا فَيُقَالُ لِي يَا مُحَمَّدُ ارْفَعْ رَأْسَكَ وَقُلْ يُسْمَعْ لَكَ وَسَلْ تُعْطَهْ وَاشْفَعْ تُشَفَّعْ فَأَقُولُ رَبِّ أُمَّتِي أُمَّتِي ‏.‏ فَيُقَالُ انْطَلِقْ فَمَنْ كَانَ فِي قَلْبِهِ مِثْقَالُ حَبَّةٍ مِنْ بُرَّةٍ أَوْ شَعِيرَةٍ مِنْ إِيمَانٍ فَأَخْرِجْهُ مِنْهَا ‏.‏ فَأَنْطَلِقُ فَأَفْعَلُ ثُمَّ أَرْجِعُ إِلَى رَبِّي فَأَحْمَدُهُ بِتِلْكَ الْمَحَامِدِ ثُمَّ أَخِرُّ لَهُ سَاجِدًا فَيُقَالُ لِي يَا مُحَمَّدُ ارْفَعْ رَأْسَكَ وَقُلْ يُسْمَعْ لَكَ وَسَلْ تُعْطَهْ وَاشْفَعْ تُشَفَّعْ ‏.‏ فَأَقُولُ أُمَّتِي أُمَّتِي ‏.‏ فَيُقَالُ لِي انْطَلِقْ فَمَنْ كَانَ فِي قَلْبِهِ مِثْقَالُ حَبَّةٍ مِنْ خَرْدَلٍ مِنْ إِيمَانٍ فَأَخْرِجْهُ مِنْهَا ‏.‏ فَأَنْطَلِقُ فَأَفْعَلُ ثُمَّ أَعُودُ إِلَى رَبِّي فَأَحْمَدُهُ بِتِلْكَ الْمَحَامِدِ ثُمَّ أَخِرُّ لَهُ سَاجِدًا فَيُقَالُ لِي يَا مُحَمَّدُ ارْفَعْ رَأْسَكَ وَقُلْ يُسْمَعْ لَكَ وَسَلْ تُعْطَهْ وَاشْفَعْ تُشَفَّعْ فَأَقُولُ يَا رَبِّ أُمَّتِي أُمَّتِي ‏.‏ فَيُقَالُ لِي انْطَلِقْ فَمَنْ كَانَ فِي قَلْبِهِ أَدْنَى أَدْنَى أَدْنَى مِنْ مِثْقَالِ حَبَّةٍ مِنْ خَرْدَلٍ مِنْ إِيمَانٍ فَأَخْرِجْهُ مِنَ النَّارِ فَأَنْطَلِقُ فَأَفْعَلُ ‏"‏ ‏.‏ هَذَا حَدِيثُ أَنَسٍ الَّذِي أَنْبَأَنَا بِهِ فَخَرَجْنَا مِنْ عِنْدِهِ فَلَمَّا كُنَّا بِظَهْرِ الْجَبَّانِ قُلْنَا لَوْ مِلْنَا إِلَى الْحَسَنِ فَسَلَّمْنَا عَلَيْهِ وَهُوَ مُسْتَخْفٍ فِي دَارِ أَبِي خَلِيفَةَ - قَالَ - فَدَخَلْنَا عَلَيْهِ فَسَلَّمْنَا عَلَيْهِ فَقُلْنَا يَا أَبَا سَعِيدٍ جِئْنَا مِنْ عِنْدِ أَخِيكَ أَبِي حَمْزَةَ فَلَمْ نَسْمَعْ مِثْلَ حَدِيثٍ حَدَّثَنَاهُ فِي الشَّفَاعَةِ قَالَ هِيهِ ‏.‏ فَحَدَّثْنَاهُ الْحَدِيثَ ‏.‏ فَقَالَ هِيهِ ‏.‏ قُلْنَا مَا زَادَنَا ‏.‏ قَالَ قَدْ حَدَّثَنَا بِهِ مُنْذُ عِشْرِينَ سَنَةً وَهُوَ يَوْمَئِذٍ جَمِيعٌ وَلَقَدْ تَرَكَ شَيْئًا مَا أَدْرِي أَنَسِيَ الشَّيْخُ أَوْ كَرِهَ أَنْ يُحَدِّثَكُمْ فَتَتَّكِلُوا ‏.‏ قُلْنَا لَهُ حَدِّثْنَا ‏.‏ فَضَحِكَ وَقَالَ خُلِقَ الإِنْسَانُ مِنْ عَجَلٍ مَا ذَكَرْتُ لَكُمْ هَذَا إِلاَّ وَأَنَا أُرِيدُ أَنْ أُحَدِّثَكُمُوهُ ‏"‏ ثُمَّ أَرْجِعُ إِلَى رَبِّي فِي الرَّابِعَةِ فَأَحْمَدُهُ بِتِلْكَ الْمَحَامِدِ ثُمَّ أَخِرُّ لَهُ سَاجِدًا فَيُقَالُ لِي يَا مُحَمَّدُ ارْفَعْ رَأْسَكَ وَقُلْ يُسْمَعْ لَكَ وَسَلْ تُعْطَ وَاشْفَعْ تُشَفَّعْ ‏.‏ فَأَقُولُ يَا رَبِّ ائْذَنْ لِي فِيمَنْ قَالَ لاَ إِلَهَ إِلاَّ اللَّهُ ‏.‏ قَالَ لَيْسَ ذَاكَ لَكَ - أَوْ قَالَ لَيْسَ ذَاكَ إِلَيْكَ - وَلَكِنْ وَعِزَّتِي وَكِبْرِيَائِي وَعَظَمَتِي وَجِبْرِيَائِي لأُخْرِجَنَّ مَنْ قَالَ لاَ إِلَهَ إِلاَّ اللَّهُ ‏"‏ ‏.‏ قَالَ فَأَشْهَدُ عَلَى الْحَسَنِ أَنَّهُ حَدَّثَنَا بِهِ أَنَّهُ سَمِعَ أَنَسَ بْنَ مَالِكٍ أُرَاهُ قَالَ قَبْلَ عِشْرِينَ سَنَةً وَهُوَ يَوْمَئِذٍ جَمِيعٌ ‏.‏