Al-Kahf ('The Cave'), 110 Meccan verses, gathers four narratives read as safeguards against life's trials: the youths who sleep for centuries in the cave, the parable of the two garden owners, Moses' journey with the servant of God (Khidr), and Dhul-Qarnayn and the barrier against Gog and Magog. It is widely recited every Friday and associated with protection from the trial of the Dajjal.
The four narratives of Al-Kahf are read by commentators, including al-Qurtubi, as answering a single underlying temptation in different registers: the sleepers of the cave facing the trial of religious persecution, the garden owner facing the trial of wealth, Moses and Khidr facing the trial of knowledge, and Dhul-Qarnayn facing the trial of power. The story of Moses' journey with al-Khidr (18:60-82), in which Khidr's seemingly destructive acts are each revealed to conceal a hidden mercy, became a foundational text for Sufi teaching on submission to a guide whose knowledge exceeds the disciple's own. Dhul-Qarnayn's identity, a two-horned ruler who travels to the rising and setting of the sun and builds a barrier against Gog and Magog, has been debated since the classical period, with proposals including Alexander the Great and Cyrus the Great, none settled with certainty in the exegetical tradition.