Surah Al-Anfaal

8:39

وَقَٰتِلُوهُمْ حَتَّىٰ لَا تَكُونَ فِتْنَةٌۭ وَيَكُونَ ٱلدِّينُ كُلُّهُۥ لِلَّهِ ۚ فَإِنِ ٱنتَهَوْا۟ فَإِنَّ ٱللَّهَ بِمَا يَعْمَلُونَ بَصِيرٌۭ

And fight them until there is no fitnah and [until] the religion, all of it, is for Allah. And if they cease - then indeed, Allah is Seeing of what they do.

Tafsir 8:39

O believers, fight your disbelieving enemies until there is no more idolatry or Muslims being stopped from Allah’s religion, when religion and obedience is for Allah alone without any partner being put alongside Him. If the disbelievers stop their idolatry and preventing Muslims from Allah’s religion, then leave them, because Allah sees what they do and nothing is hidden from Him.