Sahih Muslim Book 20, Hadith Number 4648.

Chapter : One who is killed in the way of Allah will have all his sins blotted out except debt.

Another version of the tradition differently transmitted begins with the words: “A man came to the Messenger of Allah (may peace be upon him) and he was sitting on the pulpit… He said: What do you find if I strike with the sword?” (The rest of the tradition is the same as the previous one.)