It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) went out of the Mosque towards al-Safa through the gate of Banu Makhzum.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 13324