When Abraham’s Lord tested him with certain commandments, which he fulfilled, He said, ‘I will make you a leader of people.’ Abraham asked, ‘And will You make leaders from my descendants too?’ God answered, ‘My pledge does not hold for those who do evil.’
And remember that Abraham was tried by his Lord with certain commands, which he fulfilled: He said: "I will make thee an Imam to the Nations." He pleaded: "And also (Imams) from my offspring!" He answered: "But My Promise is not within the reach of evil-doers."