Is it permissible for one to pray the Sunnah behind an Imam who is praying the obligatory Maghrib prayer, and to conclude the prayer with him after the Imam finishes the third rak'ah?
The correct view is that it is permissible for someone performing a fard (obligatory) prayer to be led by someone performing a nafl (supererogatory) prayer, and vice versa. This is the madhhab of the Shafi'is and is supported by authentic hadiths, such as the hadith of Mu'adh in the Two Sahihs. Mu'adh used to pray with the Prophet, peace and blessings be upon him, then return to his people and lead them in the same prayer, which would be a nafl prayer for him and a fard prayer for them. An example of someone performing a nafl prayer being led by someone performing a fard prayer is what was narrated by al-Tirmidhi and Ahmad from Abu Sa'id al-Khudri that a man came after the Prophet, peace and blessings be upon him, had prayed. The Prophet then said, "Who will trade with this man?" So, a man stood up and prayed with him, and his action is valid based on this opinion.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/43007