Al-Kāfi - Volume 1 > The Categories of the Prophets, the Messengers and the Imams (a.s.)
Hadith #2

2ـ مُحَمَّدُ بْنُ الْحَسَنِ عَمَّنْ ذَكَرَهُ عَنْ مُحَمَّدِ بْنِ خَالِدٍ عَنْ مُحَمَّدِ بْنِ سِنَانٍ عَنْ زَيْدٍ الشَّحَّامِ قَالَ سَمِعْتُ أَبَا عَبْدِ الله (عَلَيْهِ السَّلام) يَقُولُ إِنَّ الله تَبَارَكَ وَتَعَالَى اتَّخَذَ إِبْرَاهِيمَ عَبْداً قَبْلَ أَنْ يَتَّخِذَهُ نَبِيّاً وَإِنَّ الله اتَّخَذَهُ نَبِيّاً قَبْلَ أَنْ يَتَّخِذَهُ رَسُولاً وَإِنَّ الله اتَّخَذَهُ رَسُولاً قَبْلَ أَنْ يَتَّخِذَهُ خَلِيلاً وَإِنَّ الله اتَّخَذَهُ خَلِيلاً قَبْلَ أَنْ يَجْعَلَهُ إِمَاماً فَلَمَّا جَمَعَ لَهُ الاشْيَاءَ قَالَ إِنِّي جاعِلُكَ لِلنَّاسِ إِماماً قَالَ فَمِنْ عِظَمِهَا فِي عَيْنِ إِبْرَاهِيمَ قَالَ وَمِنْ ذُرِّيَّتِي قالَ لا يَنالُ عَهْدِي الظَّالِمِينَ قَالَ لا يَكُونُ السَّفِيهُ إِمَامَ التَّقِيِّ.

2. Muhammad ibn al-Hassan has narrated those whom he mentioned from Muhammad ibn Khalid from Muhammad ibn Sinan from Zayd al-Shahham who has said the following. “I heard Imam abu ‘Abdallah saying, ‘Allah chose Abraham as a servant before choosing him as a prophet. Allah chose him as a prophet before choosing him as a messenger. Allah chose him as a messenger before choosing him as a friend of His. Allah chose him as a friend of His before choosing him as an Imam. When all of the above things were gathered in Abraham, Allah said, “I have certainly appointed you as the Imam for the people.” Because to Abraham it was so great he asked, “Can this (Imamat, leadership) be in my descendents also?” Allah said, “The feeble-minded can become the leaders of the pious ones.”