Ata' bin al-Sa'ib (may Allah have mercy on him) narrates from his father, from his grandfather Sayyiduna Malik Abu al-Sa'ib (may Allah be pleased with him); he said: The Prophet (peace and blessings be upon him) passed by a well in which there was a dead black man. The narrator said: He (peace and blessings be upon him) looked into the well and saw that he had been thrown into it. The Prophet (peace and blessings be upon him) asked: "Why has he been thrown into the well?" The people said: O Messenger of Allah, he was very negligent in religion; sometimes he prayed and sometimes he did not pray. He (peace and blessings be upon him) said: "Woe to you! Take him out." So by the command of the Prophet (peace and blessings be upon him) he was washed and shrouded, and he (peace and blessings be upon him) said: "Carry him," and he said: "The angels were about to get ahead of us." The narrator said: And he (peace and blessings be upon him) led the funeral prayer over him.
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 16723