The Maghrib prayer is one of the five mandatorysalah. As an Islamic day starts at sunset, the Maghrib prayer is technically the first prayer of the day. If counted from midnight, it is the fourth prayer of the day. According to Sunni Muslims, the period for Maghrib prayer starts just after sunset, following Asr prayer, and ends at the beginning of night, the start of the Isha prayer. As for Shia Muslims, since they allow Maghrib and Isha prayers to be performed one after another, the period for Maghrib prayer extends until dawn. Except for the Hanafi school, however, Sunni Muslims are also permitted to combine Maghrib and Isha prayers if they are traveling and incapable of performing the prayers separately. In this case, the period for Maghrib prayer extends from sunset to dawn, as with Shiites. The formal daily prayers of Islam comprise different numbers of units, called rakat. The Maghrib prayer has three obligatory rak'at and two recommended sunnah and two non-obligatory Nafl prayer. The first two fard rak'ats are prayed aloud by the Imam in congregation, and the third is prayed silently. To be considered valid salat, the formal daily prayers must each be performed within their own prescribed time period. People with a legitimate reason have a longer period during which their prayers will be valid. The five daily prayers collectively are one pillar of the Five Pillars of Islam, in Sunni Islam, and one of the tenPractices of the Religion according to Shia Islam.
When the sun has completely set beneath the horizon; immediately after the Asr prayer period ends.
Time ends
Most scholarly opinions follow the Hanafi school, that Isha'a begins when complete darkness has arrived and the yellow twilight in the sky has disappeared.
According to a minority opinion in the Maliki school, the prescribed time for Maghrib prayer ends when the red thread has disappeared from the sky. In another opinion of the Shafi'i school, the disappearance of the red thread marks the end of the Period of Necessity. These times can be approximated by using the sun as a measure. When the sun has descended 12 degrees below the horizon, it is approximately equivalent to the disappearance of the red from the sky. For approximating when complete darkness begins, i.e. the disappearance of the white thread from the sky, some astronomers argue that it occurs when the sun has descended 15 degrees below the horizon while others use the safer number of 18 degrees. Astronomical twilight occurs when the sun is between 12 degrees and 18 degrees below the horizon.
Shia tradition
Time begins
When the redness of the eastern sky, which persists in the east for some time after sunset, disappears from above one's head when one looks vertically upwards.
Time ends
At midnight. The end of its time is after approximately eleven-and-a-quarter hours have passed from the legal noontime. This is for when one is under normal circumstances. However, in the case of one who was asleep, or forgot to perform the prayer or was coerced by extraordinary circumstances or factors beyond his control or in the case of woman whose prayer was delayed due to menstruation, the end of the Maghrib prayer time is Fajr.
Despite the relatively long period in which valid prayers can be recited, it is considered important to recite the prayer as soon as the time begins. Shia doctrine permits the mid-day and afternoon and evening and night prayers to be prayed in succession, i.e. Zuhr can be followed by Asr once the mid-day prayer has been recited and sufficient time has passed, and Maghrib can be followed by Isha'a once the evening prayer has been recited and sufficient time has passed. After the Maghrib pray begins, a special meal is eaten to break the fast. This is called Iftar.