What should I do after a bad dream or nightmare in Islam?

The short answer

The Prophet ﷺ said good dreams are from Allah and bad dreams are from Shaitan. After a bad dream, spit lightly (without saliva) three times to your left, seek refuge in Allah from Shaitan and from the dream's evil, turn over onto your other side, and do not tell anyone about it; then it will not harm you. You may also get up and pray.

Explanation

Where dreams come from. The Prophet ﷺ said: "A good dream is from Allah, and a bad or evil dream is from Satan" 1. He also described three types: good tidings from Allah, a distressing dream from Satan, and "a suggestion of one's own mind" 2. A frightening dream is not a prophecy, and you do not need to fear it.

What to do, step by step.

  • Spit "without saliva, thrice on his left and seek refuge with Allah from Satan, for it will not harm him" 3.
  • Seek refuge "from its evil and from the evil of Satan", and do not tell it to anybody 4.
  • Turn over from the side you were sleeping on 5.
  • If you wish, get up and pray, and do not relate the dream to people 2.

Shaitan cannot impersonate the Prophet ﷺ. In the same hadith he said: "Satan cannot appear in my shape" 3.

Prevention before sleep. Recite Ayat al-Kursi, which brings a guard from Allah so that no devil comes near you until morning 6. Recite al-Ikhlas, al-Falaq and an-Nas into your cupped hands and wipe over your body three times, as the Prophet ﷺ did every night 7. Recite the last two verses of Surah al-Baqarah, which he said "will be sufficient for him" at night 8.

Abu Salama said he used to see dreams that made him ill, until he heard this guidance 4. If nightmares are frequent or linked to trauma or anxiety, keep these adhkar and also consider speaking to a doctor; both are ways of taking the means Allah provided.

The evidence

  1. 1
    Hadith Sahih al-Bukhari 3292
    Sahih Bukhari

    Good dreams are from Allah and bad dreams from Satan; seek refuge and it will not harm.

    Narrated Abu Qatada:as below. Narrated Abu Qatada: The Prophet (ﷺ) said, "A good dream is from Allah, and a bad or evil dream is from Satan; so if anyone of you has a bad dream of which he gets afraid, he should spit on his left side and should seek Refuge with Allah from its evil, for then it will not harm him

    العربية

    حَدَّثَنَا أَبُو الْمُغِيرَةِ، حَدَّثَنَا الأَوْزَاعِيُّ، قَالَ حَدَّثَنِي يَحْيَى، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي قَتَادَةَ، عَنْ أَبِيهِ، عَنِ النَّبِيِّ صلى الله عليه وسلم‏.‏ حَدَّثَنِي سُلَيْمَانُ بْنُ عَبْدِ الرَّحْمَنِ، حَدَّثَنَا الْوَلِيدُ، حَدَّثَنَا الأَوْزَاعِيُّ، قَالَ حَدَّثَنِي يَحْيَى بْنُ أَبِي كَثِيرٍ، قَالَ حَدَّثَنِي عَبْدُ اللَّهِ بْنُ أَبِي قَتَادَةَ، عَنْ أَبِيهِ، قَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ الرُّؤْيَا الصَّالِحَةُ مِنَ اللَّهِ، وَالْحُلُمُ مِنَ الشَّيْطَانِ فَإِذَا حَلَمَ أَحَدُكُمْ حُلُمًا يَخَافُهُ فَلْيَبْصُقْ عَنْ يَسَارِهِ، وَلْيَتَعَوَّذْ بِاللَّهِ مِنْ شَرِّهَا، فَإِنَّهَا لاَ تَضُرُّهُ ‏"‏‏.‏

  2. 2
    Hadith Sahih Muslim 2263
    Sahih Muslim

    Three kinds of dreams; after a disliked dream, pray and do not relate it to people.

    Abu Huraira reported Allah's Messenger (ﷺ) as saying:When the time draws near (when the Resurrection is near) a believer's dream can hardly be false. And the truest vision will be of one who is himself the most truthful in speech, for the vision of a Muslim is the forty-fifth part of Prophecy, and dreams are of three types: one good dream which is a sort of good tidings from Allah; the evil dream which causes pain is from the satan; and the third one is a suggestion of one's own mind; so if any one of you sees a dream which he does not like he should stand up and offer prayer and he should not relate it to people, and he said: I would love to see fetters (in the dream), but I dislike wearing of necklace, for the fetters is (an indication of) one's steadfastness in religion. The narrator said: I do not know whether this is a part of the hadith or the words of Ibn Sirin

    العربية

    حَدَّثَنَا مُحَمَّدُ بْنُ أَبِي عُمَرَ الْمَكِّيُّ، حَدَّثَنَا عَبْدُ الْوَهَّابِ الثَّقَفِيُّ، عَنْ أَيُّوبَ السَّخْتِيَانِيِّ، عَنْ مُحَمَّدِ بْنِ سِيرِينَ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ إِذَا اقْتَرَبَ الزَّمَانُ لَمْ تَكَدْ رُؤْيَا الْمُسْلِمِ تَكْذِبُ وَأَصْدَقُكُمْ رُؤْيَا أَصْدَقُكُمْ حَدِيثًا وَرُؤْيَا الْمُسْلِمِ جُزْءٌ مِنْ خَمْسٍ وَأَرْبَعِينَ جُزْءًا مِنَ النُّبُوَّةِ وَالرُّؤْيَا ثَلاَثَةٌ فَرُؤْيَا الصَّالِحَةِ بُشْرَى مِنَ اللَّهِ وَرُؤْيَا تَحْزِينٌ مِنَ الشَّيْطَانِ وَرُؤْيَا مِمَّا يُحَدِّثُ الْمَرْءُ نَفْسَهُ فَإِنْ رَأَى أَحَدُكُمْ مَا يَكْرَهُ فَلْيَقُمْ فَلْيُصَلِّ وَلاَ يُحَدِّثْ بِهَا النَّاسَ ‏"‏ ‏.‏ قَالَ ‏"‏ وَأُحِبُّ الْقَيْدَ وَأَكْرَهُ الْغُلَّ وَالْقَيْدُ ثَبَاتٌ فِي الدِّينِ ‏"‏ ‏.‏ فَلاَ أَدْرِي هُوَ فِي الْحَدِيثِ أَمْ قَالَهُ ابْنُ سِيرِينَ ‏.‏

  3. 3
    Hadith Sahih al-Bukhari 6995
    Sahih Bukhari

    Spit dryly three times to the left and seek refuge; Satan cannot appear in the Prophet's form.

    Narrated Abu Qatada:The Prophet (ﷺ) said, "A good dream is from Allah, and a bad dream is from Satan. So whoever has seen (in a dream) something he dislikes, then he should spit without saliva, thrice on his left and seek refuge with Allah from Satan, for it will not harm him, and Satan cannot appear in my shape

    العربية

    حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، حَدَّثَنَا اللَّيْثُ، عَنْ عُبَيْدِ اللَّهِ بْنِ أَبِي جَعْفَرٍ، أَخْبَرَنِي أَبُو سَلَمَةَ، عَنْ أَبِي قَتَادَةَ، قَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ الرُّؤْيَا الصَّالِحَةُ مِنَ اللَّهِ، وَالْحُلْمُ مِنَ الشَّيْطَانِ، فَمَنْ رَأَى شَيْئًا يَكْرَهُهُ فَلْيَنْفِثْ عَنْ شِمَالِهِ ثَلاَثًا، وَلْيَتَعَوَّذْ مِنَ الشَّيْطَانِ، فَإِنَّهَا لاَ تَضُرُّهُ، وَإِنَّ الشَّيْطَانَ لاَ يَتَرَاءَى بِي ‏"‏‏.‏

  4. 4
    Hadith Sahih al-Bukhari 7044
    Sahih Bukhari

    Seek refuge from the bad dream and from Satan, spit three times and tell no one.

    Narrated Abu Salama:I used to see a dream which would make me sick till I heard Abu Qatada saying, "I too, used to see a dream which would make me sick till I heard the Prophet (ﷺ) saying, "A good dream is from Allah, so if anyone of you saw a dream which he liked, he should not tell it to anybody except to the one whom he loves, and if he saw a dream which he disliked, then he should seek refuge with Allah from its evil and from the evil of Satan, and spit three times (on his left) and should not tell it to anybody, for it will not harm him

    العربية

    حَدَّثَنَا سَعِيدُ بْنُ الرَّبِيعِ، حَدَّثَنَا شُعْبَةُ، عَنْ عَبْدِ رَبِّهِ بْنِ سَعِيدٍ، قَالَ سَمِعْتُ أَبَا سَلَمَةَ، يَقُولُ لَقَدْ كُنْتُ أَرَى الرُّؤْيَا فَتُمْرِضُنِي حَتَّى سَمِعْتُ أَبَا قَتَادَةَ يَقُولُ وَأَنَا كُنْتُ لأَرَى الرُّؤْيَا تُمْرِضُنِي، حَتَّى سَمِعْتُ النَّبِيَّ صلى الله عليه وسلم يَقُولُ ‏ "‏ الرُّؤْيَا الْحَسَنَةُ مِنَ اللَّهِ، فَإِذَا رَأَى أَحَدُكُمْ مَا يُحِبُّ فَلاَ يُحَدِّثْ بِهِ إِلاَّ مَنْ يُحِبُّ، وَإِذَا رَأَى مَا يَكْرَهُ فَلْيَتَعَوَّذْ بِاللَّهِ مِنْ شَرِّهَا، وَمِنْ شَرِّ الشَّيْطَانِ وَلْيَتْفِلْ ثَلاَثًا وَلاَ يُحَدِّثْ بِهَا أَحَدًا فَإِنَّهَا لَنْ تَضُرَّهُ ‏"‏‏.‏

  5. 5
    Hadith Sahih Muslim 2262
    Sahih Muslim

    After a disliked dream, spit left three times, seek refuge three times and turn onto the other side.

    Jabir reported Allah's Messenger (ﷺ) as saying:If anyone sees a dream which he does not like, he should spit on his left side three times, and seek refuge with Allah from the Satan three times, and let him turn over from the side on which he was sleeping

    العربية

    حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح وَحَدَّثَنَا ابْنُ رُمْحٍ، أَخْبَرَنَا اللَّيْثُ، عَنْ أَبِي، الزُّبَيْرِ عَنْ جَابِرٍ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ ‏ "‏ إِذَا رَأَى أَحَدُكُمُ الرُّؤْيَا يَكْرَهُهَا فَلْيَبْصُقْ عَنْ يَسَارِهِ ثَلاَثًا وَلْيَسْتَعِذْ بِاللَّهِ مِنَ الشَّيْطَانِ ثَلاَثًا وَلْيَتَحَوَّلْ عَنْ جَنْبِهِ الَّذِي كَانَ عَلَيْهِ ‏"‏ ‏.‏

  6. 6
    Hadith Sahih al-Bukhari 2311
    Sahih Bukhari

    Ayat al-Kursi at bedtime brings a guard; no devil comes near until morning.

    Narrated Abu Huraira: Allah's Messenger (ﷺ) deputed me to keep Sadaqat (al-Fitr) of Ramadan. A comer came and started taking handfuls of the foodstuff (of the Sadaqa) (stealthily). I took hold of him and said, "By Allah, I will take you to Allah's Messenger (ﷺ) ." He said, "I am needy and have many dependents, and I am in great need." I released him, and in the morning Allah's Messenger (ﷺ) asked me, "What did your prisoner do yesterday?" I said, "O Allah's Messenger (ﷺ)! The person complained of being needy and of having many dependents, so, I pitied him and let him go." Allah's Messenger (ﷺ) said, "Indeed, he told you a lie and he will be coming again." I believed that he would show up again as Allah's Messenger (ﷺ) had told me that he would return. So, I waited for him watchfully. When he (showed up and) started stealing handfuls of foodstuff, I caught hold of him again and said, "I will definitely take you to Allah's Messenger (ﷺ). He said, "Leave me, for I am very needy and have many dependents. I promise I will not come back again." I pitied him and let him go. In the morning Allah's Messenger (ﷺ) asked me, "What did your prisoner do." I replied, "O Allah's Messenger (ﷺ)! He complained of his great need and of too many dependents, so I took pity on him and set him free." Allah's Apostle said, "Verily, he told you a lie and he will return." I waited for him attentively for the third time, and when he (came and) started stealing handfuls of the foodstuff, I caught hold of him and said, "I will surely take you to Allah's Messenger (ﷺ) as it is the third time you promise not to return, yet you break your promise and come." He said, "(Forgive me and) I will teach you some words with which Allah will benefit you." I asked, "What are they?" He replied, "Whenever you go to bed, recite "Ayat-al-Kursi"-- 'Allahu la ilaha illa huwa-l-Haiy-ul Qaiyum' till you finish the whole verse. (If you do so), Allah will appoint a guard for you who will stay with you and no satan will come near you till morning. " So, I released him. In the morning, Allah's Apostle asked, "What did your prisoner do yesterday?" I replied, "He claimed that he would teach me some words by which Allah will benefit me, so I let him go." Allah's Messenger (ﷺ) asked, "What are they?" I replied, "He said to me, 'Whenever you go to bed, recite Ayat-al-Kursi from the beginning to the end ---- Allahu la ilaha illa huwa-lHaiy-ul-Qaiyum----.' He further said to me, '(If you do so), Allah will appoint a guard for you who will stay with you, and no satan will come near you till morning.' (Abu Huraira or another sub-narrator) added that they (the companions) were very keen to do good deeds. The Prophet (ﷺ) said, "He really spoke the truth, although he is an absolute liar. Do you know whom you were talking to, these three nights, O Abu Huraira?" Abu Huraira said, "No." He said, "It was Satan

    العربية

    وَقَالَ عُثْمَانُ بْنُ الْهَيْثَمِ أَبُو عَمْرٍو حَدَّثَنَا عَوْفٌ، عَنْ مُحَمَّدِ بْنِ سِيرِينَ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ قَالَ وَكَّلَنِي رَسُولُ اللَّهِ صلى الله عليه وسلم بِحِفْظِ زَكَاةِ رَمَضَانَ، فَأَتَانِي آتٍ فَجَعَلَ يَحْثُو مِنَ الطَّعَامِ، فَأَخَذْتُهُ، وَقُلْتُ وَاللَّهِ لأَرْفَعَنَّكَ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم‏.‏ قَالَ إِنِّي مُحْتَاجٌ، وَعَلَىَّ عِيَالٌ، وَلِي حَاجَةٌ شَدِيدَةٌ‏.‏ قَالَ فَخَلَّيْتُ عَنْهُ فَأَصْبَحْتُ فَقَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ يَا أَبَا هُرَيْرَةَ مَا فَعَلَ أَسِيرُكَ الْبَارِحَةَ ‏"‏‏.‏ قَالَ قُلْتُ يَا رَسُولَ اللَّهِ شَكَا حَاجَةً شَدِيدَةً وَعِيَالاً فَرَحِمْتُهُ، فَخَلَّيْتُ سَبِيلَهُ‏.‏ قَالَ ‏"‏ أَمَا إِنَّهُ قَدْ كَذَبَكَ وَسَيَعُودُ ‏"‏‏.‏ فَعَرَفْتُ أَنَّهُ سَيَعُودُ لِقَوْلِ رَسُولِ اللَّهِ صلى الله عليه وسلم إِنَّهُ سَيَعُودُ‏.‏ فَرَصَدْتُهُ فَجَاءَ يَحْثُو مِنَ الطَّعَامِ فَأَخَذْتُهُ فَقُلْتُ لأَرْفَعَنَّكَ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم‏.‏ قَالَ دَعْنِي فَإِنِّي مُحْتَاجٌ، وَعَلَىَّ عِيَالٌ لاَ أَعُودُ، فَرَحِمْتُهُ، فَخَلَّيْتُ سَبِيلَهُ فَأَصْبَحْتُ، فَقَالَ لِي رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ يَا أَبَا هُرَيْرَةَ، مَا فَعَلَ أَسِيرُكَ ‏"‏‏.‏ قُلْتُ يَا رَسُولَ اللَّهِ شَكَا حَاجَةً شَدِيدَةً وَعِيَالاً، فَرَحِمْتُهُ فَخَلَّيْتُ سَبِيلَهُ‏.‏ قَالَ ‏"‏ أَمَا إِنَّهُ قَدْ كَذَبَكَ وَسَيَعُودُ ‏"‏‏.‏ فَرَصَدْتُهُ الثَّالِثَةَ فَجَاءَ يَحْثُو مِنَ الطَّعَامِ، فَأَخَذْتُهُ فَقُلْتُ لأَرْفَعَنَّكَ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم، وَهَذَا آخِرُ ثَلاَثِ مَرَّاتٍ أَنَّكَ تَزْعُمُ لاَ تَعُودُ ثُمَّ تَعُودُ‏.‏ قَالَ دَعْنِي أُعَلِّمْكَ كَلِمَاتٍ يَنْفَعُكَ اللَّهُ بِهَا‏.‏ قُلْتُ مَا هُوَ قَالَ إِذَا أَوَيْتَ إِلَى فِرَاشِكَ فَاقْرَأْ آيَةَ الْكُرْسِيِّ ‏{‏اللَّهُ لاَ إِلَهَ إِلاَّ هُوَ الْحَىُّ الْقَيُّومُ‏}‏ حَتَّى تَخْتِمَ الآيَةَ، فَإِنَّكَ لَنْ يَزَالَ عَلَيْكَ مِنَ اللَّهِ حَافِظٌ وَلاَ يَقْرَبَنَّكَ شَيْطَانٌ حَتَّى تُصْبِحَ‏.‏ فَخَلَّيْتُ سَبِيلَهُ فَأَصْبَحْتُ، فَقَالَ لِي رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ مَا فَعَلَ أَسِيرُكَ الْبَارِحَةَ ‏"‏‏.‏ قُلْتُ يَا رَسُولَ اللَّهِ زَعَمَ أَنَّهُ يُعَلِّمُنِي كَلِمَاتٍ، يَنْفَعُنِي اللَّهُ بِهَا، فَخَلَّيْتُ سَبِيلَهُ‏.‏ قَالَ ‏"‏ مَا هِيَ ‏"‏‏.‏ قُلْتُ قَالَ لِي إِذَا أَوَيْتَ إِلَى فِرَاشِكَ فَاقْرَأْ آيَةَ الْكُرْسِيِّ مِنْ أَوَّلِهَا حَتَّى تَخْتِمَ ‏{‏اللَّهُ لاَ إِلَهَ إِلاَّ هُوَ الْحَىُّ الْقَيُّومُ‏}‏ وَقَالَ لِي لَنْ يَزَالَ عَلَيْكَ مِنَ اللَّهِ حَافِظٌ وَلاَ يَقْرَبَكَ شَيْطَانٌ حَتَّى تُصْبِحَ، وَكَانُوا أَحْرَصَ شَىْءٍ عَلَى الْخَيْرِ‏.‏ فَقَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ أَمَا إِنَّهُ قَدْ صَدَقَكَ وَهُوَ كَذُوبٌ، تَعْلَمُ مَنْ تُخَاطِبُ مُنْذُ ثَلاَثِ لَيَالٍ يَا أَبَا هُرَيْرَةَ ‏"‏‏.‏ قَالَ لاَ‏.‏ قَالَ ‏"‏ ذَاكَ شَيْطَانٌ ‏"‏‏.‏

  7. 7
    Hadith Sahih al-Bukhari 5017
    Sahih Bukhari

    The three Quls recited into the hands and wiped over the body before sleep.

    Narrated 'Aisha: Whenever the Prophet (ﷺ) went to bed every night, he used to cup his hands together and blow over it after reciting Surat Al-Ikhlas, Surat Al-Falaq and Surat An-Nas, and then rub his hands over whatever parts of his body he was able to rub, starting with his head, face and front of his body. He used to do that three times

    العربية

    حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا الْمُفَضَّلُ، عَنْ عُقَيْلٍ، عَنِ ابْنِ شِهَابٍ، عَنْ عُرْوَةَ، عَنْ عَائِشَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم كَانَ إِذَا أَوَى إِلَى فِرَاشِهِ كُلَّ لَيْلَةٍ جَمَعَ كَفَّيْهِ ثُمَّ نَفَثَ فِيهِمَا فَقَرَأَ فِيهِمَا ‏{‏قُلْ هُوَ اللَّهُ أَحَدٌ‏}‏ وَ‏{‏قُلْ أَعُوذُ بِرَبِّ الْفَلَقِ‏}‏ وَ‏{‏قُلْ أَعُوذُ بِرَبِّ النَّاسِ‏}‏ ثُمَّ يَمْسَحُ بِهِمَا مَا اسْتَطَاعَ مِنْ جَسَدِهِ يَبْدَأُ بِهِمَا عَلَى رَأْسِهِ وَوَجْهِهِ وَمَا أَقْبَلَ مِنْ جَسَدِهِ يَفْعَلُ ذَلِكَ ثَلاَثَ مَرَّاتٍ‏.‏

  8. 8
    Hadith Sahih al-Bukhari 5009
    Sahih Bukhari

    The last two verses of al-Baqarah at night are sufficient for the one who recites them.

    Narrated Abu Mas'ud: The Prophet (ﷺ) said, "If somebody recited the last two Verses of Surat Al-Baqara at night, that will be sufficient for him

    العربية

    حَدَّثَنَا أَبُو نُعَيْمٍ، حَدَّثَنَا سُفْيَانُ، عَنْ مَنْصُورٍ، عَنْ إِبْرَاهِيمَ، عَنْ عَبْدِ الرَّحْمَنِ بْنِ يَزِيدَ، عَنْ أَبِي مَسْعُودٍ ـ رضى الله عنه ـ قَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ مَنْ قَرَأَ بِالآيَتَيْنِ مِنْ آخِرِ سُورَةِ الْبَقَرَةِ فِي لَيْلَةٍ كَفَتَاهُ‏"‏‏.‏

This answer was compiled with the help of AI, using only the verified texts shown here. Every reference links to its source. If you find a mistake, please report it. Updated 2026-09-24

Report an issue

Tell us what is wrong. Every report is read.

What is the problem?