Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:18:86

Until, when he reached the setting of the sun, he found it ˹as if˺ setting in a spring of dark mud, and he found near it a people. Allah said, "O Dhul-Qarnayn, either you punish ˹them˺ or else adopt among them ˹a way of˺ goodness."  

until, when he reached the setting of the sun, the place where it sets, he found it setting in a muddy spring (‘ayn hami’a: ˹a spring˺ containing ham’a, which is black clay): its setting in a spring is ˹described as seen˺ from the perspective of the eye, for otherwise it is far larger ˹in size˺ than this world; and he found by it, that is, ˹by˺ the spring, a folk, of disbelievers. We said, ‘O Dhū’l-Qarnayn — by ˹means of˺ inspiration — either chastise, the folk, by slaying ˹them˺, or treat them kindly’, by ˹merely˺ taking them captive.
القرآن:١٨:٨٦

حَتَّىٰ إِذَا بَلَغَ مَغْرِبَ الشَّمْسِ وَجَدَهَا تَغْرُبُ فِي عَيْنٍ حَمِئَةٍ وَوَجَدَ عِنْدَهَا قَوْمًا ۗ قُلْنَا يَا ذَا الْقَرْنَيْنِ إِمَّا أَنْ تُعَذِّبَ وَإِمَّا أَنْ تَتَّخِذَ فِيهِمْ حُسْنًا  

{حتى إذا بلغ مغرب الشمس} موضع غروبها {وجدها تغرب في عين حمئة} ذات حمأة وهي الطين الأسود وغروبها في العين في رأي وإلا فهي أعظم من الدنيا {ووجد عندها} أي العين {قوما} كافرين {قلنا يا ذا القرنين} بإلهام {إما أن تُعذّب} القوم بالقتل {وإما أن تتخذ فيهم حُسنا} بالأسر.