It is narrated from Sayyiduna Salamah bin Akwa’ (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) used to perform the Maghrib prayer at the time of sunset, when the upper edge of the sun would set.
Hadith Referenceسنن دارمي / من كتاب الصللاة / 1243
Hadith Takhrijیہ حدیث صحیح ہے۔ دیکھے: [بخاري 561] ، [مسلم 636، نحوه] و [أبوداؤد 417، مثله] و [ترمذي 164] و [ابن ماجه 688] و [ابن حبان 1523]
Brief Explanation
(Commentary on Hadith 1242)
From this hadith, it is established that the Maghrib prayer should be performed immediately after sunset; this is indeed the initial time for the Maghrib prayer.