Abu Musa al-Ash'ari (may Allah be pleased with him) said: A man came to him (peace and blessings be upon him) and said: "O Messenger of Allah (peace and blessings be upon him), one man fights out of bravery, another out of tribal partisanship, and a third for show; which of them is in the way of Allah?" He (peace and blessings be upon him) said: "Whoever fights only so that the word of Allah becomes uppermost, he alone is in the way of Allah."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18545