Sayyiduna Anas (may Allah be pleased with him) narrates: When the Prophet (peace and blessings be upon him) passed away, his Companions were sitting around him in grief. Meanwhile a tall man came, whose face was radiant and whose speech was eloquent. He was wearing a waist-wrap and had a sheet over him; his shoulders had much hair, and his chest also had much hair. He stepped over the Companions of the Prophet (peace and blessings be upon him) and came forward, and stood by the door frame. He wept for a while, then he said: "In Allah Almighty alone is consolation for every calamity; He is the replacement for everyone who perishes, and He grants compensation for everything that is lost. So turn to Allah Almighty, and set your longing on Him, for the truly afflicted one is he who is not granted reward." Those present said: "Do you know this man?" They looked right and left, but saw no one. Then Sayyiduna Abu Bakr (may Allah be pleased with him) said: "This was the brother of the Prophet (peace and blessings be upon him), Sayyiduna al-Khidr (peace be upon him)."
Imam al-Tabarani recorded it in al-Mu'jam al-Awsat. Its chain contains a narrator, Abbad bin Abdus-Samad Abu Ma'mar, whom Imam al-Bukhari (may Allah have mercy on him) declared da'if (weak).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الجنائز / 3957