Sayyiduna Utbah bin Abd al-Sulami (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Those who are killed are of three kinds: a man who goes out with his life and his wealth against the enemy and is martyred while fighting; Allah grants this man a place beneath the Throne, and the prophets are above him by one degree, because of prophethood. And a man who, after committing sins, fights the enemy on the battlefield of jihad and is martyred; this martyrdom wipes out his sins and his mistakes, for the sword is an eraser of mistakes, and it will be said to such a man: 'Enter by whichever of the eight gates of Paradise you wish.' Paradise has eight gates and Hell has seven, and the gates of Paradise are superior to one another. And a hypocrite who is killed while fighting on the battlefield of jihad with his wealth and his life; he is of the people of Hell, for the sword does not erase hypocrisy."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18523