Surah Ali 'Imran
وَلَقَدْ صَدَقَكُمُ ٱللَّهُ وَعْدَهُۥٓ إِذْ تَحُسُّونَهُم بِإِذْنِهِۦ ۖ حَتَّىٰٓ إِذَا فَشِلْتُمْ وَتَنَـٰزَعْتُمْ فِى ٱلْأَمْرِ وَعَصَيْتُم مِّنۢ بَعْدِ مَآ أَرَىٰكُم مَّا تُحِبُّونَ ۚ مِنكُم مَّن يُرِيدُ ٱلدُّنْيَا وَمِنكُم مَّن يُرِيدُ ٱلْـَٔاخِرَةَ ۚ ثُمَّ صَرَفَكُمْ عَنْهُمْ لِيَبْتَلِيَكُمْ ۖ وَلَقَدْ عَفَا عَنكُمْ ۗ وَٱللَّهُ ذُو فَضْلٍ عَلَى ٱلْمُؤْمِنِينَ
Wa laqad ṣadaqakumullāhu wa‘dahū iż taḥussūnahum bi'iżnih(ī), ḥattā iżā fasyiltum wa tanāza‘tum fil-amri wa ‘aṣaitum mim ba‘di mā arākum mā tuḥibbūn(a), minkum may yurīdud-dun-yā wa minkum may yurīdul-ākhirah(ta), ṡumma ṣarafakum ‘anhum liyabtaliyakum, wa laqad ‘afā ‘ankum, wallāhu żū faḍlin ‘alal-mu'minīn(a).
And Allah had certainly fulfilled His promise to you when you were killing the enemy by His permission until [the time] when you lost courage and fell to disputing about the order [given by the Prophet] and disobeyed after He had shown you that which you love. Among you are some who desire this world, and among you are some who desire the Hereafter. Then he turned you back from them [defeated] that He might test you. And He has already forgiven you, and Allah is the possessor of bounty for the believers.
📝 Footnotes
125) Disputing among themselves over the Prophet's command means deciding whether to execute the order of the Prophet Muhammad (peace be upon him) for the archers to remain in their designated positions under any circumstances. 126) Namely victory and the spoils of war. 127) This means that the Muslims did not succeed in defeating them.