This mosque is located at the foot of a mountain in the south of Mina, not far from the smallest Jamarat. It was at this place that the Prophet (saw) and many other prophets before him performed salah (prayer).
Masjid Al-Khayf is a mosque, the merits of which are proven in some Hadith. According to the traced Hadith of Ibn Abbas (may Allah be pleased with him), the Prophet (saw) said: “Seventy Prophets prayed in Masjid al-Khayf.” [Majam uz-Zawahid]
Yazid bin Aswad (may Allah be pleased with him) says that when he performed the Hajj with the Prophet (saw), it was in this Mosque (Masjid Al-Khayf) that he performed the Fajr salah with the Prophet (saw).Abdur-Rahman bin Muadh (may Allah be pleased with him) reports that when the Prophet (saw) delivered a sermon in Mina, he instructed the Muhajirs to camp in front of Masjid al-Khayf and Ansar to set up a camp behind him. The rest of the Muslims were to camp behind them. [Abu Dawud]

Abdullah bin Abbas (may Allah be pleased with him) reported that it was in Masjid al-Khayf that the Prophet (saw) addressed them. After praising Allah, he said: “Allah will correct the affairs of a person whose main concern is Ahira Hereafter (Aakhirah), Allah will also provide him with self-sufficiency, and the world will humble itself before him. As for the person who primarily cares about this world, Allah will dispel his affairs, put poverty before him, and everything he receives from this world will be what is meant for him. ” [Tabraani]
Sources: The History of Makkah Mukarramah – Dr. Muhammad Ilyas Abdul Ghani, Holy Makkah – Shaikh Safiur-Rahman Mubarakpuri, Hayatus Sahabah – M. Yusuf Khandalvi