Abu Musa reported: A man asked the Prophet, “A man may fight to be courageous, another may fight for zeal, and another may fight to show off. Which of these is fighting in the way of Allah?” The Messenger of Allah, peace and blessings be upon him, said, “He who fights to raise the word of Allah is in the way of Allah.”
Source: Ṣaḥīḥ al-Bukhārī 123, Ṣaḥīḥ Muslim 1904
Grade: Muttafaqun Alayhi (authenticity agreed upon) according to Al-Bukhari and Muslim
Ibn Hajar said, “The meaning of the ‘word of Allah’ is the invitation (da’wah) to Islam. It is interpreted to mean that jihad would not be in the cause of Allah unless the purpose is only to raise the word of Allah, such that if anyone were to add another reason to it, that would violate it.”
Source: Fatḥ al-Bārī 6/28
عَنْ أَبِي مُوسَى قَالَ سُئِلَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ عَنْ الرَّجُلِ يُقَاتِلُ شَجَاعَةً وَيُقَاتِلُ حَمِيَّةً وَيُقَاتِلُ رِيَاءً أَيُّ ذَلِكَ فِي سَبِيلِ اللَّهِ فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ مَنْ قَاتَلَ لِتَكُونَ كَلِمَةُ اللَّهِ هِيَ الْعُلْيَا فَهُوَ فِي سَبِيلِ اللَّهِ
123 صحيح البخاري كتاب العلم باب من سأل وهو قائم عالما جالسا
1904 صحيح مسلم كتاب الإمارة باب من قاتل لتكون كلمة الله هي العليا فهو في سبيل الله
قال ابن حجر العسقلاني الْمُرَادُ بِكَلِمَةِ اللَّهِ دَعْوَةُ اللَّهِ إِلَى الْإِسْلَامِ وَيَحْتَمِلُ أَنْ يَكُونَ الْمُرَادُ أَنَّهُ يعني الجهاد لَا يَكُونُ فِي سَبِيلِ اللَّهِ إِلَّا مَنْ كَانَ سَبَبُ قِتَالِهِ طَلَبَ إِعْلَاءِ كَلِمَةِ اللَّهِ فَقَطْ بِمَعْنَى أَنَّهُ لَوْ أَضَافَ إِلَى ذَلِكَ سَبَبًا مِنَ الْأَسْبَابِ الْمَذْكُورَةِ أَخَلَّ بِذَلِكَ
فتح الباري شرح صحيح البخاري 6/28