Anas ibne-Malik RadhiyAllahu 'anhu narrates that Rasulullah Sallallahu 'alaihi wa sallam said:
On the Day of Resurrection, mankind will be in confusion. Then they will approach Adam 'Alaihis Salam and say: Intercede for us before your Rabb. He will reply: I am not eligible to intercede, you should approach Ibrahim, as he is the Khalil (close friend) of Ar-Rahman. So, they will approach Ibrahim 'Alaihis Salam, but he will say to them: I am not eligible, you should approach Musa, as he is Kalimullah (who speaks to Allah Ta'ala). So, they will approach Musa 'Alaihis Salam, but he will say: I am not eligible, you should approach 'Isa, as he is Ruhullah and Kalimatullah (the Spirit of Allah, and Word of Allah). So, they will approach 'Isa 'Alaihis Salam; but he will say: I am not eligible, you should approach Muhammad Sallallahu 'alaihi wa sallam. Thus, they will approach me and I will say, I am the one to intercede. So I will beseech my Rabb; and He will oblige me. Then He will inspire me with such words that I will praise Him with, but I have no knowledge of these words now. So I will praise Him by those praises and will fall in prostration. Then it will be said: O Muhammad! Raise your head; speak, you will be heard; ask, you will be granted; intercede, your intercession will be accepted. So, I will submit: O my Rabb! My Ummah! My Ummah! (Have mercy on it). It will then be said: Go and take out of the Fire whoever has, in his heart, Iman equivalent to a grain of barley. So, I will go and obey as commanded.
Then I will return and praise Him again by the same praises and will fall in prostration. Then it will be said: O Muhammad! Raise your head; speak, you will be heard; ask, you will be granted; intercede, your intercession will be accepted. So I will beseech: O My Rabb! My Ummah! My Ummah! Then it will be said: Go and take out from the Fire whoever has, in his heart, Iman equivalent to a particle of dust or a mustard seed. So, I will go and comply with the command.
Then I will return and, praise Him once more by the same praises and will fall in prostration. Then it will be said: O Muhammad! Raise your head; speak, you will be heard; ask, you will be granted; intercede, your intercession will be accepted. So I will implore: O My Rabb! My Ummah! My Ummah! Then it will be said: Go and take out from the Fire whoever has Iman, in his heart, as much as the smallest, smallest, smallest grain of mustard seed. So I will go and do as bidden.
And then, I will return for the fourth time and praise Him by the same praises and will fall in prostration. Then it will be said: O Muhammad! Raise your head; speak, you will be heard; ask, you will be granted; intercede, your intercession will be accepted. So I will urge: O My Rabb! Permit me (to intercede) for anyone who has said La ilaha illallah. Thus, Allah Subhanahu wa Ta'ala will say: By My Honour, and By My Majesty, and By My Grandeur, and By My Sublimity; whoever has said La ilaha illallah, I will certainly take him out of the Fire. [Bukhari]
And in the narration of Abu Sa'id Al Khudri Radhiyallahu 'anhu: (In reply to the urges of Rasulullah Sallallahu 'alaihi wa sallam for the fourth time) Allah Subhanahu wa Ta'ala will say: The Angels have interceded, and the Prophets have interceded, and the believers have interceded, and none remain except the Most Merciful of the Merciful. He will then grasp a handful from the Fire, taking out those who had not done a single virtuous act, and who had been turned to charcoal. He will then put them into a river of life at the entrance of Paradise, called Nahar-ul-Hayat (the River of Life). They will be revived like the seedlings that sprout in the silt carried by a flood. And they will come forth like pearls; around their necks shall be straps of gold. The dwellers of Paradise will recognize them by these straps as those whom Allah had released from the Fire and made to enter Paradise without having done any good deed. Then Allah will say to them: Enter into Paradise, and whatever you have seen is yours. So they will say: O our Rabb! You have given us what none was given in the world! He will reply: For you I have something better than this. They will say: O our Rabb! What could be better than this? He will then reply: My Pleasure, and now I will never be angry with you. [Muslim]