Abdullah bin Masud reported,

The Messenger of Allah ﷺ said, "Our Lord عز وجل marvels at a man who fights in the way of Allah and is defeated, but then realizes his duty and returns to the battle until his blood is shed. Allah عز وجل says to His angels, 'Look at My servant. He returned out of longing for what is with Me and out of fear of what is with Me, until his blood was shed.'"In another narration, "Our Lord marvels at two men. A man who rises from his bedding and blanket, leaving his beloved and his family, to perform his prayer. Allah جل وعلا says to His angels, 'Look at My servant. He rose from his bed and his bedding, leaving his beloved and his family, to perform his prayer, out of longing for what is with Me and out of fear of what is with Me.' And a man who fights in the way of Allah." Then he mentioned the rest of the hadith.

Azami 383

Sahih

عن عبد الله بن مسعود قال

قال رسول الله ﷺ: عجب ربنا عز وجل من رجل غزا في سبيل الله فانهزم، فعلم ما عليه فرجع حتى أهريق دمه، فيقول الله عز وجل لملائكته: انظروا إلى عبدي، رجع رغبة فيما عندي وشفقة مما عندي حتى أهريق دمه. وفي رواية: عجب ربنا من رجلين رجل ثار على وطائه ولحافه من بين حبه وأهله إلى صلاته. فيقول الله جل وعلا لملائكته: انظروا إلى عبدي ثار عن فراشه ووطائه من بين حبه وأهله إلى صلاته رغبة فيما عندي وشفقة مما عندي، ورجل غزا في سبيل الله. فذكر الحديث.

الأعظمي 383صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Faith in Allah عز وجل
Section
Affirming amazement to Allah the Exalted
Numbering
Jami al-Kamil 383 (2nd edition)
Azami 383