The Messenger of Allah ﷺ used to pray Maghrib the moment the sun set, as soon as its upper edge disappeared.
قال حدثنا صفوان قال حدثنا ابن أبي عبيد
كان رسول الله ﷺ يصلي المغرب ساعة تغرب الشمس إذا غاب حاجبها
Its chain of transmission is sahih, its narrators have already been mentioned. Bukhari related the hadith, 2/41, no. 561 in Fath al-Bari, in the Book of Prayer Times, the chapter on the time of Maghrib, and Muslim, 1/441, no. 636, in the Book of Mosques, the chapter clarifying the beginning of the time of Maghrib, and Tirmidhi, 1/304, no. 164, and Nasai, 1/225, no. 688, and Abu Dawud, 1/113, no. 417.