Sayyiduna al-Irbad bin Sariyah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Indeed I was written with Allah in the Mother of the Book as the Seal of the Prophets while Adam (peace be upon him) was still lying in his clay. I will tell you its interpretation: (it is) the supplication of Ibrahim (peace be upon him), the supplication in which he said: 'Our Lord, send among them a messenger from themselves' [Surah al-Baqarah: 129]; and the glad tidings of Isa bin Maryam (peace be upon them both): 'And bringing glad tidings of a messenger who will come after me, whose name will be Ahmad' [Surah al-Saff: 6]; and the dream my mother saw in her sleep, that she gave birth to a light by which the palaces of Syria were lit up."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 15722