On the authority of Anas (may Allah be pleased with him) from the Prophet (ﷺ), who said:

The believers will gather together on the Day of Resurrection and will say: Should we not ask [someone] to intercede for us with our Lord? So they will come to Adam and will say: You are the Father of mankind; Allah created you with His hand, He made His angels bow down to you and He taught you the names of everything, so intercede for us with your Lord so that He may give us relief form this place where we are. And he will say: I am not in a position [to do that] - and he will mention his wrongdoing and will feel ashamed and will say: Go to Noah, for he is the first messenger that Allah sent to the inhabitants of the earth. So they will come to him and he will say: I am not in a position [to do that] - and he will mention his having requested something of his Lord about which he had no [proper] knowledge (Quran Chapter 11 Verses 45-46), and he will feel ashamed and will say: Go to the Friend of the Merciful (Abraham). So they will come to him and he will say: I am not in a position [to do that]. Go to Moses, a servant to whom Allah talked and to whom He gave the Torah. So they will come to him and he will say: I am not in a position [to do that] - and he will mention the taking of a life other that for a life (Quran Chapter 28 Verses 15-16), and he will feel ashamed in the sight of his Lord and will say: Go to Jesus, Allah's servant and messenger, Allah's word and spirit. So they will come to him and he will say: I am not in a position [to do that]. Go to Muhammad (may the blessings and peace of Allah be upon him), a servant to whom Allah has forgiven all his wrongdoing, past and future. So they will come to me and I shall set forth to ask permission to come to my Lord, and permission will be given, and when I shall see my Lord I shall prostrate myself. He will leave me thus for such time as it pleases Him, and then it will be said [to me]: Raise your head. Ask and it will be granted. Speak and it will be heard. Intercede and your intercession will be accepted. So I shall raise my head and praise Him with a form of praise that He will teach me. Then I shall intercede and He will set me a limit [as to the number of people], so I shall admit them into Paradise. Then I shall return to Him, and when I shall see my Lord [I shall bow down] as before. Then I shall intercede and He will set me a limit [as to the number of people]. So I shall admit them into Paradise. Then I shall return for a third time, then a fourth, and I shall say: There remains in Hell-fire only those whom the Qur'an has confined and who must be there for eternity. There shall come out of Hell-fire he who has said: There is no god but Allah and who has in his heart goodness weighing a barley-corn; then there shall come out of Hell-fire he who has said: There is no god but Allah and who has in his heart goodness weighing a grain of wheat; then there shall come out of Hell-fire he who has said: There is no god but Allah and who has in his heart goodness weighing an atom. It was related by al-Bukhari (also by Muslim, at-Tirmidhi, and Ibn Majah).