God ordered Ibrahim (a.s.) to sacrifice his son Ismai’l (a.s.). He did this to examine Ibrahim’s (a.s.) patience and obedience to Allah. If Ibrahim (a.s.) passed this test, he would demonstrate his worthiness of Allah’s grace and favour.
Having been bestowed with a child after years of loneliness without any children, he was being ordered by God to sacrifice with his own hands the apple of his eyes, who had grown up to become a young boy of 13.
Ibrahim (a.s.) said to Ismai’l (a.s.):
“O’ My beloved son! I have dreamt that I am sacrificing you; what do you think about this?”
“Dear father! Act as you have been ordered and, God willing, you shall find me of the steadfast ones,” Ismai’l (a.s.) replied.
Then, he strengthened his father’s resolve by advising:
“Father, death is very painful and I am so fearful of it that its very thought leaves me disturbed and distressed, so bind my hands and legs firmly, lest I beat about with them while my throat is being slit and thereby reduce the rewards ordained for me. In addition, sharpen the knife so that I am put at peacequickly. Also, place me with my face towards the ground and not upon my cheeks for I fear that if your eyes fall upon my face, compassion might overtake you and prevent you from complying with the Divine commandment. Take off your garments so that my blood does not taint them and my mother does not see my blood. If you deem it fit, take my clothes to my mother; they might serve to console her and lessen her grief at my death.”
Hearing this speech, Ibrahim (a.s.) responded, “O’ Son! You are indeed an excellent aide (to me) in executing God’s commandment.”
Ibrahim (a.s.) took his son to Mina (the place of sacrifice), sharpened the knife and then binding Ismai’l’s (a.s.) hands and legs, laid him with his face towards the ground. Ibrahim then raised his head towards the heavens and placed the knife on his son’s throat. But, as he did so, he realized that the knife did not cut. Looking at it, he noticed that the sharp knife had turned blunt. This occurrence was repeated several times, when suddenly a heavenly voice was heard saying:
O’ Ibrahim! Indeed, you have acted as you had dreamt and have complied with the commandment given to you.
As a substitute for the sacrifice of Ismai’l (a.s.), Jibraeel brought a goat, which Ibrahim (a.s.) subsequently sacrificed. From here, it became a custom that those performing the hajj every year should offer a sacrifice at Mina.( Taareekh-e-Anbiya, vol. 1, pg. 164-169 )