Sunan an-Nasa'i, Book 25, Hadith 73 (In-Book)

It was narrated from 'Abdullah bin Qatadah that he heard Abu Qatadah narrate from the Messenger of Allah, that he stood up among them and said that Jihad in the cause of Allah and belief in Allah are the best of deeds. Then a man stood up and said: "O Messenger of Allah, if I am killed in the cause of Allah, will Allah forgive my sins?" The Messenger of Allah said: "Yes, if you are killed in the cause of Allah, and you are patient and seek reward, and you are facing the enemy, not running way - except for debt. Jibril (peace be upon him) told me that."

أَخْبَرَنَا قُتَيْبَةُ، قَالَ حَدَّثَنَا اللَّيْثُ، عَنْ سَعِيدِ بْنِ أَبِي سَعِيدٍ، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي قَتَادَةَ، عَنْ أَبِي قَتَادَةَ، أَنَّهُ سَمِعَهُ يُحَدِّثُ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَامَ فِيهِمْ فَذَكَرَ لَهُمْ ‏"‏ أَنَّ الْجِهَادَ فِي سَبِيلِ اللَّهِ وَالإِيمَانَ بِاللَّهِ أَفْضَلُ الأَعْمَالِ ‏"‏ ‏.‏ فَقَامَ رَجُلٌ فَقَالَ يَا رَسُولَ اللَّهِ أَرَأَيْتَ إِنْ قُتِلْتُ فِي سَبِيلِ اللَّهِ أَيُكَفِّرُ اللَّهُ عَنِّي خَطَايَاىَ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ نَعَمْ إِنْ قُتِلْتَ فِي سَبِيلِ اللَّهِ وَأَنْتَ صَابِرٌ مُحْتَسِبٌ مُقْبِلٌ غَيْرُ مُدْبِرٍ إِلاَّ الدَّيْنَ فَإِنَّ جِبْرِيلَ عَلَيْهِ السَّلاَمُ قَالَ لِي ذَلِكَ ‏"‏ ‏.‏

sunnah.com