The Prophet ﷺ reported from his Lord that He said, "Any servant of Mine who goes out as a fighter in the cause of Allah, seeking My pleasure, I guarantee that if I return him, I will return him with what he has gained of reward or spoils, and if I take his soul, I will forgive him and have mercy on him."
أخبرني إبراهيم بن يعقوب قال حدثنا حجاج قال حدثنا حماد بن سلمة عن يونس عن الحسن
عن النبي ﷺ فيما يحكيه عن ربه عز وجل قال أيما عبد من عبادي خرج مجاهدا في سبيل الله ابتغاء مرضاتي ضمنت له أن أرجعه إن أرجعته بما أصاب من أجر أو غنيمة وإن قبضته غفرت له ورحمته
[Sahih] Ahmad narrated it: 2/117, from the hadith of Hammad bin Salama, with this same chain, and it is found in Kubra, no. 4334, and it has many corroborating narrations, among them the preceding hadith, no. 3126.