وَلَقَدْ عَلِمْتُمُ الَّذِينَ اعْتَدَوْا مِنكُمْ فِي السَّبْتِ فَقُلْنَا لَهُمْ كُونُوا قِرَدَةً خَاسِئِينَ
Wa laqad 'alimtumal lazeena'tadaw minkum fis Sabti faqulnaa lahum koonoo qiradatan khaasi'een
You already know about those among you who transgressed the Sabbath, and we said to them, "Be apes, despised."
The transformation has been read literally by most commentators and figuratively by some, with Mujahid's reading that hearts rather than bodies were changed transmitted widely enough that al-Tabari records it while disagreeing. Khāsi'īn, the word paired with it, is used of driving off a dog. The verse opens by saying the audience already knows this story, so it is invoked rather than told.