Ubayd bin Khalid reported,

The Prophet ﷺ established a bond of brotherhood between two men. One of them was killed during the time of the Prophet ﷺ, and later the other died. The people prayed over him, and the Prophet ﷺ asked, "What did you say?"They replied, "We said, 'O Allah, forgive him. O Allah, have mercy on him. O Allah, join him with his companion.'"The Prophet ﷺ said, "But where are his prayers compared to the other's prayers? Where is his fasting, or his deeds, compared to the other's deeds? The distance between them is greater than the distance between the heavens and the earth."

Ahmad 16074

Sahih

حدثنا أبو النضر قال حدثنا شعبة عن عمرو بن مرة قال سمعت عمرو بن ميمون يحدث عن عبد الله بن ربيعة السلمي

عن عبيد بن خالد السلمي وكان من أصحاب النبي ﷺ قال

آخى النبي ﷺ بين رجلين قتل أحدهما على عهد النبي ﷺ ثم مات الآخر فصلوا عليه فقال النبي ﷺ ما قلتم قال قلنا اللهم اغفر له اللهم ارحمه اللهم ألحقه بصاحبه فقال النبي ﷺ فأين صلاته بعد صلاته وأين صيامه أو عمله بعد عمله ما بينهما أبعد ما بين السماء والأرض

أحمد 16074صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Ubayd bin Khalid Sulami
Numbering
Darussalam 16074
Ahmad 16074