Sayyiduna Umar bin Al-Khattab (may Allah be pleased with him) said: In the days of ignorance, people used to depart from Muzdalifah to Mina after the sun had risen, saying, "O Thubayr, shine so that we may depart" (Thubayr is the name of a mountain in Muzdalifah, located on the left when coming to Mina). But the Messenger of Allah (peace and blessings be upon him), opposing them, performed the prayer early and departed before sunrise. The narrator is in doubt whether he said «صلاة المسفرين» or «صلاة المشرقين» for the Fajr prayer.
Hadith Referenceسنن دارمي / من كتاب المناسك / 1928
In some narrations, it is reported from Sayyiduna Ibn Mas'ud radi Allahu anhu that only in Muzdalifah did the Messenger of Allah sallallahu alayhi wa sallam perform the Fajr prayer much earlier, in darkness. Some scholars have deduced from this that, except in Muzdalifah, the Prophet sallallahu alayhi wa sallam would perform the Fajr prayer after daylight had spread, but this is not correct. The correct view is that in Muzdalifah, he performed it somewhat earlier, and outside of Muzdalifah, he would delay it slightly, but the prayer was always performed in "ghalas" (darkness), to the extent that a person sitting nearby or a woman walking could not be recognized. This was because, before sunrise, it was necessary to go to Mina and to perform the ritual stoning (rami) and sacrifice (qurbani), so the Prophet sallallahu alayhi wa sallam performed the Fajr prayer earlier.