"And fight them until there is no more Fitnah (disbelief and polytheism, i.e., worshipping others besides Allah) and the religion (worship) will be all for Allah (Alone) (in the whole of the world)..." (V.8:39) Sahih al-Bukhari 4651

Arabic hadith text
حَدَّثَنَا أَحْمَدُ بْنُ يُونُسَ، حَدَّثَنَا زُهَيْرٌ، حَدَّثَنَا بَيَانٌ، أَنَّ وَبَرَةَ، حَدَّثَهُ قَالَ حَدَّثَنِي سَعِيدُ بْنُ جُبَيْرٍ، قَالَ خَرَجَ عَلَيْنَا أَوْ إِلَيْنَا ابْنُ عُمَرَ، فَقَالَ رَجُلٌ كَيْفَ تَرَى فِي قِتَالِ الْفِتْنَةِ‏.‏ فَقَالَوَهَلْ تَدْرِي مَا الْفِتْنَةُ كَانَ مُحَمَّدٌ صلى الله عليه وسلم يُقَاتِلُ الْمُشْرِكِينَ، وَكَانَ الدُّخُولُ عَلَيْهِمْ فِتْنَةً، وَلَيْسَ كَقِتَالِكُمْ عَلَى الْمُلْكِ‏.‏
Translation
Narrated Sa`id bin Jubair

Ibn `Umar came to us and a man said (to him), "What do you think about 'Qit-alal-Fitnah' (fighting caused by afflictions)." Ibn `Umar said (to him), "And do you understand what an affliction is? Muhammad used to fight against the pagans, and his fighting with them was an affliction, (and his fighting was) not like your fighting which is carried on for the sake of ruling."