Maghrib prayer
The Maghrib prayer (Arabic: صلاة المغرب ṣalāt al-maġrib, '"West [sun] prayer"), prayed just after sunset, is the fourth of five formal daily prayers (salat) performed by practicing Muslims.
The formal daily prayers of Islam comprise different numbers of units, called rak'at.
The Maghrib prayer has three obligatory (fard) rak'at and two recommended sunnah and two non-obligatory nafls. The first two fard rak'ats are prayed aloud by the Imam in congregation, (the person who missed 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.
Time begins
When the sun has completely set beneath the horizon; immediately after the Asr prayer period ends.
Time ends
According to the predominant opinions of the Maliki and Shafi'i schools of law, the prescribed prayer time ends as soon as enough time for a person to purify him/herself and pray has passed. After that, according to the Maliki school, the Period of Necessity lasts until a little before dawn, i.e., the beginning of Fajr prayer.