The Maghrib prayer (صلاة المغرب , "vespers") is the fourth of the five mandatory salah (Islamic prayer).
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 the midnight. 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. Amongst Sunnis, Salafis allow the combining of two consecutive prayers (Maghrib & Isha'a, Dhuhr & 'Asr) for a wide range of reasons; such as when various needs arise or due to any difficulty (taking precedence from Hanbali and Shafiite schools).
The formal daily prayers of Islam comprise different numbers of units, called rakat. The Maghrib prayer has three obligatory (fard) rak'at and two sunnah and two non-obligatory nafls. The first two fard rak'ats are prayed aloud by the Imam in congregation (the person who misses the congregation and is offering prayer alone is not bound to speak the first two rak'ats aloud), 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 ten Practices of the Religion (Furū al-Dīn) according to Shia Islam.
Time begins
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.