Uqba bin Amir reported,

I heard the Messenger of Allah ﷺ say, "Every deceased person has their deeds sealed upon death, except for the one who guards the frontier in the path of Allah. The reward of his deeds continues to flow for him until the Day of Resurrection, and he is granted safety from the trial of the grave."

Azami 3882

Hasan

عن عقبة بن عامر يقول

سمعت رسول الله ﷺ يقول: كل ميت يحتم على عمله إلا المرابط في سبيل الله، فإنه يجرى له أجر عمله حتى يبعث. ويؤمن من فتان القبر.

الأعظمي 3882حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Conditions of the deceased in the grave
Section
Ribat in the cause of Allah is a protection from the punishment of the grave
Numbering
Jami al-Kamil 3882 (2nd edition)
Azami 3882