It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that "I was a young boy, and I used to graze the goats of Uqbah bin Abi Mu'ayt in Makkah. Once the Messenger of Allah (peace and blessings be upon him) and Sayyiduna Abu Bakr (may Allah be pleased with him), escaping from the polytheists, came to me and asked: O boy! Do you have some milk you can give us to drink? I said: I am entrusted (with them), so I cannot give you two milk to drink. They said: Do you have a young goat which a male has not yet covered? I said: Yes. So I brought one such goat to them. Sayyiduna Abu Bakr (may Allah be pleased with him) held it, and the Messenger of Allah (peace and blessings be upon him) took hold of its udder and prayed, and it filled with milk. Then Sayyiduna Abu Bakr (may Allah be pleased with him) brought a hollowed-out rock and he (peace and blessings be upon him) milked into it. Then he (peace and blessings be upon him) and Sayyiduna Abu Bakr (may Allah be pleased with him) drank that milk and also gave me to drink. After that he (peace and blessings be upon him) said to the udder: 'Uqlus' (Shrink), and it (at once) returned to its original state. Some time after this incident I came to the Messenger of Allah (peace and blessings be upon him) and said: Teach me some of this pure speech, that is, the Qur'an. The Messenger of Allah (peace and blessings be upon him) said: 'You are a boy who has been taught (by Allah).' So I learned seventy surahs directly from his (peace and blessings be upon him) blessed mouth, in which no one can dispute with me or equal me."
Imam Abu Bakr bin Abi Shaybah, Ahmad bin Mani' and Abu Ya'la al-Mawsili also recorded it with different chains. In the narration of Ahmad bin Mani' the words are: "He (peace and blessings be upon him) passed his hand over its udder, and (when I asked him to teach me the speech) he (peace and blessings be upon him) passed his hand over my head with affection and said: 'May Allah have mercy on you; you are a boy who has been taught.'" In the second narration of Abu Ya'la it says: "I learned seventy surahs from his (peace and blessings be upon him) blessed tongue, in which no human being can claim to equal me."
This narration is also found in brief form in Sahih al-Bukhari and Muslim and other books of hadith.