Where the story is told
The main account is in Surah al-A'raf, Quran 7:163-166. Allah tells the Prophet ﷺ to ask the Children of Israel about the town that was by the sea. It is also mentioned briefly in Quran 2:65-66, and in 4:47 and 5:60.
The Sabbath was a day the Children of Israel were commanded to keep, and the Quran also mentions a command given to them not to transgress in it (4:154). The Quran describes this story as a lesson for those who heard it then and for those who came after.
The test of the Sabbath
The meaning of Quran 7:163 is that the people of the town transgressed in the matter of the Sabbath. Their fish came to them openly on the day of their Sabbath, and on the days they did not keep the Sabbath, the fish did not come. Allah says that He tested them in this way because they were defiantly disobedient.
The test was real and hard for them. What was forbidden was in front of them, and on other days it was out of reach. The verse says they transgressed, but it does not describe how they did it.
The people of the town did not all respond in the same way. The verses point to three groups:
- Those who broke the limit that Allah had set.
- Those who advised them and forbade the wrong.
- A community who said to the advisers, "Why do you advise a people whom Allah is about to destroy or punish severely?" (7:164).
The advisers and what they answered
The advisers answered that they spoke to be excused before their Lord and in the hope that the people might fear Him (7:164). They did not give up the duty of advising, even when others told them it was pointless.
Then the people forgot what they had been reminded of. Allah saved those who had forbidden evil and seized those who did wrong with a severe punishment, because of their disobedience (7:165).
Allah then says that when they were insolent about what they had been forbidden, He said to them, "Be apes, despised" (7:166). In Surah al-Baqarah, the Children of Israel are reminded that they already knew of those among them who transgressed concerning the Sabbath, and Allah made the event a deterrent for those present and for those after them, and a lesson for those who fear Allah (2:65-66).
What scholars said about the apes
Most commentators understood the verses literally: those people were physically transformed. A view attributed to Mujahid, one of the early scholars among the Successors, is that the verses describe a transformation of their hearts and character, so that they resembled apes in their behaviour. This difference is about how the transformation happened. All scholars accept that it was a punishment and a warning.
Quran 5:60 speaks of those whom Allah cursed and with whom He became angry, and made some of them apes and pigs. It does not mention the Sabbath by name, and many commentators connect it with the same event. Quran 4:47 also warns about being cursed as the Sabbath-breakers were cursed.
The verses say nothing about what became of the middle group, those who stayed silent or objected to the advice. Scholars have discussed this, but the Quran does not say, so it is better not to state it as fact.
What the Quran does not tell us
The Quran does not name the town. Some commentators say it was Ayla, on the coast of the Red Sea, but this is not stated in the Quran. It also does not give the time, the number of people, how many were saved, or how exactly the people broke the Sabbath.
Stories about the details of the trick are found in books of commentary, not in the verses, so we do not rely on them. What the verses do say is enough for the lesson.
Lessons from this story
- Allah's limits are to be respected in their purpose as well as in their wording. Looking for a way around a command, while seeming to obey it, is a danger the scholars have drawn from this story.
- Calling to good and forbidding wrong matters even when the result is uncertain. The advisers said they spoke to be excused before their Lord and in hope that the people might fear Him.
- Being tested by what is tempting is a part of faith. The people were tried when the forbidden thing was easy to reach.
- Allah saves those who forbid evil. The verse mentions their rescue first, before the punishment of the wrongdoers.
- Allah's punishments of earlier peoples are a warning and a lesson for those who fear Him, as Quran 2:66 says.
General information for learning, not a fatwa. For your own situation, ask a qualified scholar.