Qur'an 3:166
وَمَآ أَصَـٰبَكُمْ يَوْمَ ٱلْتَقَى ٱلْجَمْعَانِ فَبِإِذْنِ ٱللَّهِ وَلِيَعْلَمَ ٱلْمُؤْمِنِينَ
“And what struck you on the day the two armies met [at Uḥud] was by permission of Allāh that He might make evident the [true] believers”
Aal-i-Imraan 3:166 · Saheeh International