Skip to main content
Published on

How to Pray Maghrib: Step-by-Step Guide

Authors
  • Sih C.
    Name
    Sih C.
    Role
    Founder & Islamic Content Researcher • Islamful
How to pray Maghrib — step-by-step guide to the sunset prayer in Islam

Maghrib arrives the instant the sun slips below the horizon, and its window closes faster than any other prayer. That short timeframe is exactly why it is easy to miss if you are not paying attention — and why praying it the moment the adhan sounds is the safest habit you can build.

Maghrib is also unique in its shape. It is the only one of the five daily prayers with three obligatory rakahs, mixing aloud and silent recitation in a way no other prayer does. This guide covers when the window opens and closes, exactly how to pray the three rakahs, what to recite, the madhab differences, and the mistakes people make most.

What you'll learn:

  • When the Maghrib window opens and closes
  • The three fard rakahs and the two sunnah rakahs after them
  • The full step-by-step method, including the silent third rakah
  • The differences between the madhabs and the common mistakes to avoid

What Is Maghrib and Why Does It Matter?

Maghrib (مَغْرِب) is the sunset prayer, the fourth of the five daily prayers. It is prayed in the window that opens the moment the sun has fully set.

Allah (SWT) commands prayer across the day and into the night in the Quran:

وَأَقِمِ الصَّلَاةَ طَرَفَيِ النَّهَارِ وَزُلَفًا مِّنَ اللَّيْلِ ۚ إِنَّ الْحَسَنَاتِ يُذْهِبْنَ السَّيِّئَاتِ

Wa aqim as-salata tarafayi an-nahari wa zulafan mina al-layl, inna al-hasanati yudhhibna as-sayyi'at

"And establish prayer at the two ends of the day and at the approach of the night. Indeed, good deeds do away with misdeeds." — Surah Hud, 11:114

The "approach of the night" (zulafan mina al-layl) is understood to include Maghrib, the prayer that marks the transition from day into darkness. The Prophet Muhammad (peace be upon him) was so attached to praying it early that he would lead it as soon as the sun set and the adhan was called.

When Is the Time for Maghrib?

The Maghrib window is the shortest of the day, with a clear start and end:

  • Start: the moment the entire disc of the sun has set below the horizon.
  • End: when the red twilight (ash-shafaq al-ahmar) disappears from the western sky.

The Prophet ﷺ gave the boundary directly. He said:

"When you pray Maghrib, its time is until the twilight has disappeared." — Narrated by Muslim (Sahih Muslim 612a)

That gives you roughly an hour to ninety minutes. Because the exact sunset shifts every single day, never estimate it — check your accurate local prayer times so you catch the start of this short window and do not let it slip past.

How Many Rakahs Is Maghrib?

Maghrib is the only prayer with three fard rakahs — an odd number that sets it apart. After the fard, the Prophet ﷺ regularly prayed two sunnah rakahs at home.

PartRakahsRuling
Fard (obligatory)3Required
Sunnah after Maghrib2Highly recommended (sunnah mu'akkadah)
Total5

Only the three fard rakahs are obligatory. There are no fixed sunnah rakahs before Maghrib, though the Prophet ﷺ permitted a light voluntary prayer for whoever wished, saying "Pray before the Maghrib prayer" and then, so people would not treat it as binding, "for whoever wishes" (Sahih al-Bukhari 1183).

Step-by-Step: How to Pray Maghrib

First, make sure you have valid wudu — if you need it, see our guide on how to perform wudu. Then face the qiblah and make your intention for the three fard rakahs of Maghrib in your heart.

  1. Opening takbir. Stand, raise your hands to your shoulders or ears, and say:

    اللَّهُ أَكْبَر — Allahu Akbar — "Allah is the Greatest."

  2. First rakah — recite aloud. Place your right hand over your left. Recite Surah Al-Fatiha, then another surah or some verses. Maghrib is recited out loud in the first two rakahs, so say it audibly.

  3. Bow (ruku). Say Allahu Akbar, bend with a flat back and hands on your knees, and say three times:

    سُبْحَانَ رَبِّيَ الْعَظِيم — Subhana Rabbi al-Adheem — "Glory to my Lord, the Most Great."

  4. Rise, then prostrate twice. Stand upright saying Sami'a Allahu liman hamidah, Rabbana wa laka al-hamd. Then say Allahu Akbar, go into prostration (sujud) with forehead, nose, palms, knees, and toes on the ground, and say three times: Subhana Rabbi al-A'la — "Glory to my Lord, the Most High." Sit briefly, then prostrate a second time. That completes the first rakah.

  5. Second rakah — recite aloud. Stand saying Allahu Akbar and repeat the same pattern: Al-Fatiha plus a surah aloud, ruku, and two prostrations.

  6. First tashahhud. After the second prostration of the second rakah, sit and recite the tashahhud (At-tahiyyatu lillahi…). Do not give salam yet — Maghrib has a third rakah.

  7. Third rakah — recite silently. Stand saying Allahu Akbar and recite only Surah Al-Fatiha, this time silently. There is no second surah in the third rakah. Then perform ruku and the two prostrations as before.

  8. Final tashahhud and salam. Sit again, complete the full tashahhud, send blessings on the Prophet ﷺ (the salawat), then turn your face right and left, each time saying:

    السَّلَامُ عَلَيْكُمْ وَرَحْمَةُ اللَّه — As-salamu alaykum wa rahmatullah — "Peace and the mercy of Allah be upon you."

That completes the three fard rakahs. If you can, follow them with the two sunnah rakahs, recited silently, prayed the same way as any two-rakah prayer.

For the complete pattern that applies to all five prayers, see our full guide on how to pray salah for beginners.

Search your city or use your location

Because the Maghrib window is so short, timing is everything — use the prayer times above to know the exact moment the sun sets where you live.

Differences Between the Madhabs

The four schools agree Maghrib is three fard rakahs recited aloud in the first two. The main practical difference is over when the window ends.

AspectHanafiShafi'iMalikiHanbali
End of windowWhen white twilight fades (Abu Hanifa); red twilight per the two companionsRed twilight disappearsRed twilight disappearsRed twilight disappears
Sunnah after2 rakahs2 rakahs2 rakahs2 rakahs
Praying earlyStrongly preferredStrongly preferredStrongly preferredStrongly preferred

In practice, the majority position — and the one most prayer-time tables follow — is that Maghrib ends when the red twilight disappears. All four schools agree the prayer itself is three fard rakahs and that praying it early is best.

Common Mistakes to Avoid

  • Delaying it too long. Maghrib has the shortest window. Praying it early, soon after sunset, is the sunnah and the safest way not to miss it.
  • Giving salam after two rakahs. Maghrib is three rakahs. Sit for the first tashahhud after the second rakah, but stand again — do not end the prayer there.
  • Reciting a second surah in the third rakah. The third rakah is only Surah Al-Fatiha, recited silently. Adding another surah is a mistake.
  • Reciting the whole prayer aloud. Only the first two rakahs are audible. The third rakah is silent.
  • Skipping the two sunnah rakahs. They are a confirmed sunnah the Prophet ﷺ rarely left — try to keep them.

Frequently Asked Questions

Can I still pray Maghrib after the twilight has gone? The twilight disappearing marks the start of Isha. If you genuinely missed Maghrib, pray it as a missed prayer as soon as you remember, before praying Isha, since the order of prayers should be kept where possible.

Is Maghrib the same as the sunset prayer? Yes. "Maghrib" simply means the time of sunset, and the Maghrib prayer is the one offered right after the sun has set. It is sometimes called the evening prayer, though Isha is the later night prayer.

Do I need to pray the two rakahs before Maghrib? No. They are optional, not a confirmed sunnah. The Prophet ﷺ permitted them "for whoever wishes" (Sahih al-Bukhari 1183) but did not make them a standing practice, so there is no blame in leaving them.

Summary

Maghrib is short, early, and distinct — the only prayer with three fard rakahs.

  • Maghrib is three fard rakahs: the first two recited aloud, the third silently with only Al-Fatiha.
  • Its window runs from sunset until the red twilight disappears (Sahih Muslim 612a).
  • Follow the fard with two sunnah rakahs, and pray it early as the Prophet ﷺ did.

Guard the short Maghrib window, and you seal your day with the prayer that closes it. And Allah knows best (والله أعلم).

Frequently Asked Questions

How many rakahs is Maghrib prayer?

Maghrib has three obligatory (fard) rakahs, the only prayer with an odd number of fard. After them, the Prophet, peace be upon him, regularly prayed two sunnah rakahs. So the full Maghrib is five rakahs: three fard followed by two sunnah. Only the three fard are required.

What is the time for Maghrib prayer?

Maghrib begins the moment the sun fully sets below the horizon and ends when the red twilight disappears from the sky. It is the shortest prayer window, usually around an hour to ninety minutes. The Prophet, peace be upon him, prayed it early, soon after sunset.

Do you recite Maghrib out loud or silently?

The first two rakahs of Maghrib are recited aloud, like Fajr and Isha. In the third rakah you recite only Surah Al-Fatiha, and you say it silently. So Maghrib mixes audible and silent recitation: aloud for the first two rakahs, quiet for the third.

Why does Maghrib have three rakahs?

Maghrib is the only one of the five daily prayers with three fard rakahs. Scholars note it functions as the witr (odd-numbered) prayer of the daytime, sealing the day with an odd count. The number was fixed by the practice of the Prophet, peace be upon him, and transmitted unbroken since.