The Statement of Allah the Exalted: Verily! You (O Muḥammad pbuh) guide not whom you like, but Allah guides whom He wills... (V.28:56)

Hadith Number 4772

setting

Narrated Al-Musaiyab

When Abu Talib was on his death bed, Allah's Messenger (ﷺ) came to him and found with him, Abu Jahl and `Abdullah bin Abi Umaiya bin Al-Mughira. Allah's Messenger (ﷺ) said, "O uncle! Say: None has the right to be worshipped except Allah, a sentence with which I will defend you before Allah." On that Abu Jahl and `Abdullah bin Abi Umaiya said to Abu Talib, "Will you now leave the religion of `Abdul Muttalib?" Allah's Messenger (ﷺ) kept on inviting him to say that sentence while the other two kept on repeating their sentence before him till Abu Talib said as the last thing he said to them, "I am on the religion of `Abdul Muttalib," and refused to say: None has the right to be worshipped except Allah. On that Allah's Messenger (ﷺ) said, "By Allah, I will keep on asking Allah's forgiveness for you unless I am forbidden (by Allah) to do so." So Allah revealed:-- 'It is not fitting for the Prophet (ﷺ) and those who believe that they should invoke (Allah) for forgiveness for pagans.' (9.113) And then Allah revealed especially about Abu Talib:--'Verily! You (O, Muhammad) guide not whom you like, but Allah guides whom He will.' (28.56)