Surah Nisa No. 4 Ayat No. 47
يَا أَيُّهَا الَّذِينَ أُوتُوا الْكِتَابَ آَمِنُوا بِمَا نَزَّلْنَا مُصَدِّقًا لِمَا مَعَكُمْ مِنْ قَبْلِ أَنْ نَطْمِسَ وُجُوهًا فَنَرُدَّهَا عَلَى أَدْبَارِهَا أَوْ نَلْعَنَهُمْ كَمَا لَعَنَّا أَصْحَابَ السَّبْتِ وَكَانَ أَمْرُ اللَّهِ مَفْعُولًا ﴿4:47﴾
“O you people, who were given the earlier Books! Do believe in the Book which We have now revealed, which confirms the revelation which you already possess. Do this, before We tarnish your faces, and turn them on your backs, or lay a curse upon them as We cursed the Sabbath-men. Bear in mind that Allah's command is ever fulfilled “.
'Sabbath', which means Saturday, was declared for the Israelis as the holi day of the week. Allah declared the Sabbath as a sign of the perpetual covenant between Him and Israelis. It was laid down that the Israelis should dedicate the saturday for rest and worship. The Israelis were required to strictly keep the Sabbath which meant that they may not engage in any worldly activity; they may not cook. The injunctions, in this connection were so strict that violation of the Sabbath was to be punished with death. When religious and moral things declined among them, they indulged in open desecration of the Sabbath, so much so that in jewish towns trade and commerce were carried out in broad daylight.
The details of this incident are mentioned later in Surah 7, ayat no. 163.
Please remember that men are tested by Allah in a variety of ways. When a person or group of people begin to turn away from Allah and incline themselves towards disobedience, Allah provides abundant opportunities for them to disobey and then after giving them a long rope they are punished.
The manner in which this incident is mentioned the Qur'an seem to suggest that there was a physical transformation of certain persons into apes. It might have happened that their minds were allowed to remain intact, but their bodies were changed into those of apes.
Most scholars identify this place with Eilat. The seaport called Elat which has been built by the present state of Israel (which is close to the Jordanian seaport, Aqaba). The Prophet Hazrat Sulaiman took this city as the chief port for his fleet in the Red Sea.