In regard to the words of Allah, the Exalted and Glorious, "Your Lord brought forth their offspring from the loins of the children of Adam." (7:172) Ubayy said: He gathered them and paired them then fashioned them and endowed them with the power of speech and they began to speak. He then made an agreement and covenant with them. He made them bear witness about themselves (saying) Am I not your Lord. They said: Yes. He said: I call to witness seven heavens and seven earths regarding you and I call witness your father Adam regarding you lest you should say on the Day of Resurrection: We do not know this. Bear this in mind that there is no god besides Me and there is no Lord besides Me and do not associate anything with Me. It is I Who should be sending to you My messengers in order to remind you My agreement and My covenant and it is I who would send you My Books. They said: We bear witness to the fact that Thou art our Lord, Thou art our Object of worship. There is no Lord besides Thee and there is no object of worship besides Thee. They confirmed this (pledge). Adam was raised above them so that he would see them and he saw the rich and the poor, those having handsome faces and even those inferior to them and he said: My Lord, why is it that Thou hast not made Thy servants alike? He said: I wish that I should be thanked. And he also saw the Prophets, some amongst them like lamps with light in them, distinguished by another covenant regarding messengership and prophethood, viz. the words of the Blessed and the High: And when We made covenant with the prophets - up to His words: Jesus son of Mary (33:7). He was among those spirits and He sent him to Mary (peace be upon both of them). And it is narrated by Ubayy that he entered by her mouth.
Transmitted by Ahmad.