Qur'an, As-Saffat. Surah 37:99-106
He said: "I will go to my Lord! He will surely guide me!
"O my Lord! Grant me a righteous (son)!"
So We gave him the good news of a boy ready to suffer and forbear.
Then, when (the son) reached (the age of) (serious) work with him, he said: "O my son! I see in vision that I offer thee in sacrifice: Now see what is thy view!" (The son) said: "O my father! Do as thou art commanded: thou will find me, if Allah so wills one practising Patience and Constancy!"
So when they had both submitted their wills (to Allah., and he had laid him prostrate on his forehead (for sacrifice),
We called out to him "O Abraham! Thou hast already fulfilled the vision!" - thus indeed do We reward those who do right.
For this was obviously a trial.