- Published on
Dua for Nightmares: What the Sunnah Teaches
- Authors

- Name
- Ahmad
- Role
- Senior Marketing Manager, Islamic education โข DeenUp
ุจูุณูู ู ุงูููู ุงูุฑููุญูู ูฐูู ุงูุฑููุญูููู ู
In the name of God, the Most Gracious, the Most Merciful.

Waking in the middle of the night from a disturbing dream is an experience almost every person knows. For Muslims, the Sunnah does not leave us to handle this alone โ the Prophet Muhammad ๏ทบ gave us a precise, practical response that brings peace and spiritual protection in those disorienting moments.
Understanding what Islam teaches about nightmares also changes how we relate to them. They are not random signals from the subconscious or omens about the future. They have a defined source and a defined remedy. That clarity is itself reassuring.
What Islam Teaches About Dreams
The Prophet ๏ทบ divided dreams into categories that Islamic scholars have built upon ever since:
"The true dream is from Allah, and the bad dream is from Shaytan. So whoever sees something he dislikes, let him blow to his left three times, and seek refuge with Allah from Shaytan โ and then it will not harm him." โ (Sahih Muslim 2261)
A good dream โ ru'ya (ุฑูุคูููุง) โ is a mercy from Allah. A bad dream โ hulm (ุญูููู ) โ is from Shaytan, who uses it to cause distress and anxiety. This is not metaphorical in Islamic understanding; it is a real distinction with real consequences.
The Prophet ๏ทบ was clear: a bad dream has no power over you once you respond correctly. You do not need to interpret it, dwell on it, or worry about what it might mean. The response itself closes the door.
The Quran also addresses the reality of spiritual influence on the human experience at night. Surah Al-Baqarah's most famous verse โ Ayatul Kursi โ speaks directly to this, affirming that Allah's knowledge and guardianship extend over everything, including the unseen world that operates while we sleep:
"Allah โ there is no deity except Him, the Ever-Living, the Sustainer of existence. Neither drowsiness overtakes Him nor sleep..." โ (Surah Al-Baqarah, 2:255, quran.com)
The Dua After a Nightmare
When you wake from a nightmare, the Sunnah prescribes a specific sequence. Do each step before settling back to sleep:
Step 1: Spit lightly (nafth) to your left side three times. This is a dry blow โ no saliva โ directed away from you. The scholars explain that this is a physical act of dismissal, rejecting what Shaytan sent.
Step 2: Seek refuge from Shaytan by saying "A'udhu billahi min ash-Shaytan ir-rajim" (ุฃูุนููุฐู ุจูุงูููููู ู ููู ุงูุดููููุทูุงูู ุงูุฑููุฌููู ู).
Step 3: Recite this dua:
ุฃูุนููุฐู ุจูููููู ูุงุชู ุงูููููู ุงูุชููุงู ููุงุชู ู ููู ุบูุถูุจููู ููุนูููุงุจููู ููุดูุฑูู ุนูุจูุงุฏููู ููู ููู ููู ูุฒูุงุชู ุงูุดููููุงุทูููู ููุฃููู ููุญูุถูุฑูููู
A'udhu bi kalimatillahit-tammati min ghadabihi wa 'iqabihi wa sharri 'ibadihi wa min hamazatish-shayatini wa an yahdurun
"I seek refuge in the Perfect Words of Allah from His anger and His punishment, from the evil of His servants, and from the temptations of the devils and their presence." โ (Abu Dawud 3893)
Step 4: Change your sleeping position โ turn to your other side.
Step 5: Do not tell others about the bad dream. The Prophet ๏ทบ was explicit that bad dreams should not be shared. Giving them verbal expression and audience gives them more weight than they deserve.
These five steps are the complete prophetic response. They are simple enough to remember even when groggy in the middle of the night.
The Context: Abu Hurairah and the Nighttime Guardian
One of the most vivid stories about nighttime spiritual protection in the hadith involves Abu Hurairah ุฑุถู ุงููู ุนูู. The Prophet ๏ทบ put him in charge of guarding the zakah of Ramadan. A man came to steal from it โ three nights in a row. Each time, Abu Hurairah caught him. On the third night, the man said: "Let me go and I will teach you something that will benefit you." He then told him:
"When you go to bed, recite Ayatul Kursi โ and Allah will appoint a guardian over you, and Shaytan will not come near you until morning."
When Abu Hurairah reported this to the Prophet ๏ทบ, he said: "He told you the truth, even though he is a liar. That was Shaytan." โ (Sahih al-Bukhari 2311)
The night-time thief was Shaytan himself, and even he could not deny the power of Ayatul Kursi. The protection is real. The recitation before sleep is not simply a ritual โ it is a shield.
Preventive Duas Before Sleep
The best response to nightmares is preventing them before they occur. The Sunnah gives us a complete set of nighttime recitations:
1. Ayatul Kursi (Surah Al-Baqarah, 2:255) Recite once before sleep. This is the strongest individual protection in the Sunnah, confirmed by the hadith of Abu Hurairah above.
2. The Last Two Verses of Surah Al-Baqarah (2:285-286) The Prophet ๏ทบ said: "Whoever recites the last two verses of Surah Al-Baqarah at night, they will be sufficient for him." โ (Sahih al-Bukhari 5010). Scholars explain "sufficient" to mean sufficient for protection and sufficiency in affairs.
3. Surah Al-Ikhlas, Al-Falaq, and An-Nas Recite each three times, blowing into your cupped hands after each and wiping over your body. This is the practice of the Prophet ๏ทบ narrated by Aisha ุฑุถู ุงููู ุนููุง in Sahih al-Bukhari 5017.
4. The Sleeping Dua
ุงููููููู ูู ุจูุงุณูู ููู ุฃูู ููุชู ููุฃูุญูููุง
Allahumma bismika amutu wa ahya
"O Allah, with Your Name I die and I live." โ (Sahih al-Bukhari 6312)
This dua reframes sleep itself: it is a minor death, and we surrender to it in the name of Allah. That surrender โ conscious, intentional โ is the opposite of the anxious drift that makes nightmares more likely.
If you want these recitations in a consistent daily routine, the full set of evening adhkar is covered in daily duas for Muslim life, which you can use as a nightly checklist.
For a broader approach to nighttime spiritual practice, how to pray tahajjud is a natural complement โ many Muslims who pray tahajjud regularly report that their sleep is more settled and their nights more spiritually anchored.
Make your evening adhkar a nightly habit
DeenUp sends evening adhkar reminders so you never miss the protective recitations before sleep โ including Ayatul Kursi and the Sunnah sleeping dua.
Download DeenUp โ Free on iOSQuranic Answers 24/7
Ask any Islamic question and get answers rooted in Quran and Sunnah from trusted scholars.
Daily Verses & Duas
Start each day with a Quranic verse and curated duas for every moment of your life.
Track Your Deen
Build Islamic habits with daily tracking, streaks, and reflection quizzes.
Related Protective Duas
General protection: Dua for protection and safety covers the broader set of prophetic duas for daily and nightly protection โ useful for building a complete shield of remembrance throughout your day.
When facing difficulty: Sometimes a period of bad dreams accompanies a difficult season of life. Dua for help in difficult times addresses how to draw on supplication when life feels heavy.
Waking for fajr: If a bad dream wakes you close to fajr time, treat it as an unexpected gift โ you have been given the best time for supplication. How to wake up for fajr has practical guidance for turning that early waking into a consistent prayer habit.
Night prayer habits: Demimanifest's guide to night prayer habits explores how regular nighttime worship reshapes your relationship with sleep and darkness entirely โ trading fear for anticipation.
For deeper reading on the spiritual care of the self during difficult nights, deenback.com's guide to tahajjud and night prayer is a valuable companion to the material here.
Common Questions
Do I need to perform wudu after a nightmare before going back to sleep? There is no Islamic obligation to perform wudu after a nightmare specifically. Wudu would only be required if the dream led to a state of janabah (major ritual impurity). If you had a disturbing dream but nothing requiring ghusl, reciting the dua and changing your sleeping position is sufficient.
What if I keep having the same nightmare repeatedly? The Sunnah response remains the same โ recite the protective duas, do not give the dream interpretive weight, and do not share it. If the frequency causes significant distress, scholars recommend increasing general dhikr throughout the day, being consistent with the evening adhkar, and checking whether there is a waking-life stressor that needs attention. The goal is not to analyze the dream but to strengthen your overall spiritual state.
Can children be taught these duas? Absolutely. Teaching children the bedtime recitations is one of the most valuable Islamic practices parents can establish. Children who learn Ayatul Kursi and the sleeping dua early carry that protection with them for life. Start with the short dua โ Allahumma bismika amutu wa ahya โ and build from there.
Is it permissible to seek interpretation of bad dreams from a scholar? The Sunnah specifically advises against telling bad dreams to others, including scholars. Good dreams can be shared with trusted people, including those with knowledge of dream interpretation. Bad dreams should be kept private and handled with the prophetic response.
Nightmares Do Not Define You
A disturbing dream, no matter how vivid, has no authority over you. The Prophet ๏ทบ did not leave us to wonder or worry โ he gave us a precise response and the assurance that following it removes any harm.
The real work happens before sleep: the evening adhkar, the Ayatul Kursi, the intentional surrender of Allahumma bismika amutu wa ahya. That practice does not just protect against bad dreams โ it transforms how you experience the whole of the night.
Build these recitations into your routine one at a time. Start tonight with Ayatul Kursi. Add the last two verses of Surah Al-Baqarah next week. Let the habit grow.
Never skip your evening adhkar again
DeenUp reminds you to recite your protective duas before sleep and tracks your nightly dhikr โ so the Sunnah protections become second nature.
Download DeenUp โ Free on iOSFrequently Asked Questions
What dua do you say after a nightmare in Islam?
The Prophet taught seeking refuge in the Perfect Words of Allah from His anger, punishment, the evil of His servants, and the temptations of devils โ from Abu Dawud 3893. Spit lightly to the left three times and change your sleeping position.
What does Islam say about bad dreams?
Bad dreams (ahlam) are from Shaytan. The Prophet taught not to worry about them, not to tell others, to spit lightly to the left three times, and to seek refuge with Allah โ from Sahih Muslim 2261.
Does reciting Ayatul Kursi before sleep prevent nightmares?
The Prophet told Abu Hurairah that reciting Ayatul Kursi before sleep appoints a guardian over the believer, keeping Shaytan away until morning. It is one of the most effective prophetic protections for nighttime.
Should I tell someone about my bad dream?
The Prophet specifically advised not to share bad dreams with others. Keeping it private, seeking refuge with Allah, and not giving the dream attention are the Sunnah-based responses.
What is the difference between a good dream and a nightmare in Islam?
A good dream (ru'ya) is from Allah, while a bad dream (hulm) is from Shaytan. A good dream can be shared with people you trust; a bad dream should be kept private and responded to with the prophetic recitations.