Ubayd bin Khalid reported,

The Messenger of Allah ﷺ established a bond of brotherhood between two men. One of them was killed, and the other died sometime later. We performed the funeral prayer over him, and the Messenger of Allah ﷺ asked, "What did you say in your prayer for him?"They replied, "We supplicated for him, asking that he be forgiven, shown mercy, and joined with his companion."The Messenger of Allah ﷺ said, "But what about the prayers he offered after his companion's prayers, the deeds he performed after his companion's deeds, and the fasts he observed after his companion's fasts? Indeed, what lies between them is like the distance between the heavens and the earth."

Ahmad 17923

Sahih

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

عن عبيد بن خالد رجل من بني سليم قال

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

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