The Messenger of Allah (sawa) narrates that: When the Almighty Allah created Prophet Ibrahim (as), He lifted the veil from his eyes. He saw the a light at the side of Arsh.
He asked: O Lord, what are these lights?
Allah (swt) said: They are My chosen ones from My creatures.
Then he saw a light on the other side.
He asked: O Lord, what is this light?
Allah (swt) replied: He is Ali, the helper of My religion.
At the side of those two lights, were three more lights.
He asked: What are these lights?
Reply came: They are the lights of Fatima, daughter of Muhammad, and Hasan and Hussain, sons of Fatima and Ali ibn Abi Talib (as).
He asked: O my Lord, I can see nine lights, which are surrounding the five lights.
Voice came: They are Ali ibn Hussain, Muhammad ibn Ali, Jafar ibn Muhammad, Moosa ibn Jafar, Ali ibn Moosa, Muhammad ibn Ali, Ali ibn Muhammad, Hasan ibn Ali and Hujjat ibn Hasan, who will reappear from his occultation from his Shia and supporters.
Ibrahim (as) asked: O my Lord; I can see numerous lights that are surrounding them, which none can enumerate, except You; what are those lights?
Allah (swt) replied: They are the lights of their Shia and the Shia of Ali ibn Abi Talib (as), who is the Amirul Momineen.
Ibrahim asked: Through what can the Shia of Amirul Momineen be recognized?
Allah (swt) replied : Fifty-one units of prayers; that is they should pray 51 rakats in twenty-four hours, and recite the Bismillah aloud; that is to recite it in ritual prayer and supplicating in ritual prayer before genuflection (Ruku) and to place the forehead on the dust after ritual prayer and wearing a ring in the right hand.
Ibrahim (as) asked: O Allah (swt), please make me a Shia of Amirul Momineen (as).
Reply came: O Ibrahim. We have included you among the Shia of Ali ibn Abi Talib (as)
That is why Almighty Allah revealed in the Holy Quran regarding Prophet Ibrahim (as):
“وَإِنَّ مِنْ شِيعَتِهِ لَإِبْرَاهِيمَ” [Surah Saffat 37:83]
“And most surely Ibrahim followed his way”
Mufazzal said: It is narrated to us that when Prophet Ibrahim (as) perceived that his end was near, he narrated this traditions to his companions and went into prostration. His soul was taken while he was in prostration.

Source: Kefaayatul Mohtadi, Hadith #6 (See Image below)