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:10:90

And We took the Children of Israel across the sea, and Pharaoh and his soldiers pursued them in tyranny and enmity until, when drowning overtook him, he said, "I believe that there is no deity except that in whom the Children of Israel believe, and I am of the Muslims."  

And We brought the Children of Israel across the sea; and Pharaoh pursued them, he caught up with them, together with his hosts, in insolence and transgression (baghyan wa-‘adwan: these constitute the ˹direct˺ object denoting reason), until, when the ˹fate of˺ drowning overtook him, he said, ‘I believe that (annahu is ˹to be understood as˺ bi-annahu; a variant reading has innahu, ‘truly it is …’ indicating a new sentence) there is no god save Him in whom the Children of Israel believe, and I am of those who submit ˹to Him˺’: he reiterated this ˹his submission to God˺ so that it might be accepted from him, but it was not; and Gabriel thrust mud from the sea into his mouth, lest ˹God’s˺ mercy embrace him. And he ˹Gabriel˺ said to him:
القرآن:١٠:٩٠

وَجَاوَزْنَا بِبَنِي إِسْرَائِيلَ الْبَحْرَ فَأَتْبَعَهُمْ فِرْعَوْنُ وَجُنُودُهُ بَغْيًا وَعَدْوًا ۖ حَتَّىٰ إِذَا أَدْرَكَهُ الْغَرَقُ قَالَ آمَنْتُ أَنَّهُ لَا إِلَٰهَ إِلَّا الَّذِي آمَنَتْ بِهِ بَنُو إِسْرَائِيلَ وَأَنَا مِنَ الْمُسْلِمِينَ  

{وجاوزنا ببني إسرائيل البحر فأتْبَعَهُمْ} لحقهم {فرعون وجنود بغيا وعدوا} مفعول له {حتى إذا أدركه الغرق قال آمنت أنه} أي بأنه وفي قراءة بالكسر استئنافا {لا إله الذي آمنت به بنو إسرائيل وأنا من المسلمين} كرره ليقبل منه فلم يقبل، ودس جبريل في فيه من حمأة البحر مخافة أن تناله الرحمة، وقال له.