The prophet Abraham became Imam at the end of his life in age 99 …
- Allah wanted to put them to test, and it was a tough test indeed. During one night, Abraham had a dream. He came to Ismail and said: “O my son ! I have seen in a dream that I am slaughtering you as a sacrifice to Allah, so what do you think?” They both realized that this was an order from Allah. Ismail said without hesitation: “Do what you are commanded, you shall find me very patient insha Allah.” They had both submitted to the will of Allah. Abraham laid his son prostrate, put his forehead on the ground and directed a sharp knife towards his neck. At this very moment, Allah called him: “O Abraham! You have fulfilled the dream! Thus do We reward the good doers !” A big sheep was sent down from heaven to be slaughtered instead of Ismail, which Ibrahim did, and they both had a big celebration that day. This event is celebrated every year by all Muslims. It is Eid al-Adha where we slaughter the sacrificial sheep.
He passed the God exams and God give him the best gift.He became Imam .
(وَإِذِ ابْتَلَىٰ إِبْرَاهِيمَ رَبُّهُ بِكَلِمَاتٍ فَأَتَمَّهُنَّ ۖ قَالَ إِنِّي جَاعِلُكَ لِلنَّاسِ إِمَامًا ۖ قَالَ وَمِن ذُرِّيَّتِي ۖ قَالَ لَا يَنَالُ عَهْدِي الظَّالِمِينَ ﴿١٢٤بقره
And remember when his lord tried Abraham with (His) commands , and he fulfilled them ; He said : lo! I have appointed thee an imam for mankind. (Abraham) said : And of my offspring (will there be leaders and imams) ? He said : my convenant includeth not wrongdoers
(Al- Baqarah 124)