Quran 3:152 — The Amramites (Ali-'Imran)
GOD has fulfilled His promise to you, and you defeated them by His leave. But then you wavered, disputed among yourselves, and disobeyed after He had shown you (the victory) you had longed for. But then, some of you became distracted by the spoils of this world, while others were rightly concerned with the Hereafter. He then diverted you from them to test you. He has pardoned you. GOD showers the believers with His grace.
[3:151] We will throw terror into the hearts of those who disbelieved, since they set up besides GOD powerless idols. Their destiny is Hell; what a miserable abode for the transgressors!
[3:153] Recall that you rushed (after the spoils), paying no attention to anyone, even when the messenger was calling from behind you. Consequently, He substituted one misery for another, that you may not grieve over anything you had missed, or agonize over any hardship you had suffered. GOD is Cognizant of everything you do.