Umar bin Khattab and Uthman bin Affan would pray Maghrib as soon as they saw the darkness of night, before breaking their fast, and then they would break their fast after the prayer. This was during Ramadan.
و حدثني عن مالك عن ابن شهاب
أن عمر بن الخطاب وعثمان بن عفان كانا يصليان المغرب حين ينظران إلى الليل الأسود قبل أن يفطرا ثم يفطران بعد الصلاة وذلك في رمضان