Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "Indeed, Allah Almighty took Sayyiduna Ibrahim (peace be upon him) as His Khalil (intimate friend), and indeed your master (that is, the Prophet (peace and blessings be upon him)) is the Khalil of Allah, and Sayyiduna 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 (al-Maqam al-Mahmud)." (Allamah al-Haythami says:) I say: In the Sahih, only this part of it is mentioned: "And your master (that is, the Prophet (peace and blessings be upon him)) is the Khalil of Allah," and that is in the middle of a hadith.
Al-Tabarani recorded it; its chain contains a narrator, Yahya al-Himmani, and he is da'if (weak).