Sahih Muslim Book 20, Hadith Number 4647.

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

The tradition has been narrated through a different chain of transmitters on the authority of Abu Qatada who said: A man came to the Messenger of Allah (may peace be upon him) while he was on the pulpit and said: Do you think if I am killed in the way of Allah… (except this difference in its beginning, the rest of the tradition is the same as the previous one).