It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Allah, the Mighty and Majestic, took Ibrahim (peace be upon him) as a khalil (intimate friend), and your companion (I) is also the khalil of Allah, and Muhammad (peace and blessings be upon him) will be the leader of the children of Adam on the Day of Resurrection." Then he recited this verse: "It may be that your Lord will raise you to a praised station (Maqam Mahmud)" [Surah al-Isra: 79].
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10218