Musayab bin Hazn reported,

When Abu Talib was on his deathbed, the Messenger of Allah ﷺ came to him and found Abu Jahl and Abdullah bin Abu Umaya bin Mughira there with him.The Messenger of Allah ﷺ said, "Uncle, say, 'There is no god but Allah,' a word by which I may testify on your behalf before Allah."Abu Jahl and Abdullah bin Abu Umaya said, "Abu Talib, will you turn away from the religion of Abdul-Muttalib?"The Messenger of Allah ﷺ kept presenting it to him and repeating the same statement, until the last words Abu Talib spoke to them were that he was upon the religion of Abdul-Muttalib, and he refused to say, "There is no god but Allah."The Messenger of Allah ﷺ said, "By Allah, I will surely seek forgiveness for you so long as I am not forbidden from doing so."Then Allah عز وجل revealed, "It is not for the Prophet and those who believe to ask forgiveness for the polytheists, even if they are close relatives, after it has become clear to them that they are companions of the Hellfire" [Tawbah 9:113].And Allah the Exalted revealed concerning Abu Talib, addressing the Messenger of Allah ﷺ, "Indeed, you do not guide whom you love, but Allah guides whom He wills, and He knows best those who are guided" [Qasas 28:56].

Azami 12518

Sahih

عن المسيب بن حزن: قال

لما حضرت أبا طالب الوفاة جاءه رسول الله ﷺ، فوجد عنده أبا جهل، وعبد الله بن أبي أمية بن المغيرة، فقال رسول الله ﷺ: يا عم! قل: لا إله إلا الله. كلمة أشهد لك بها عند الله فقال أبو جهل وعبد الله بن أبى أمية: يا أبا طالب! أترغب عن ملة عبد المطلب؟ فلم يزل رسول الله ﷺ يعرضها عليه، ويعيد له تلك المقالة، حتى قال أبو طالب آخر ما كلمهم: هو على ملة عبد المطلب. وأبى أن يقول: لا إله إلا الله. فقال رسول الله ﷺ: أما والله لأستغفرن لك ما لم أنه عنك فأنزل الله عز وجل: {ما كان للنبي والذين ءامنوا أن يستغفروا للمشركين ولو كانوا أولي قربى من بعد ما تبين لهم أنهم أصحب الجحيم} وأنزل الله تعالى في أبي طالب، فقال الرسول الله ﷺ: {إنك لا تهدي من أحببت ولكن الله يهدى من يشاء وهو أعلم بالمهتدين} [القصص: ٥٦].

الأعظمي 12518صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "It is not for the Prophet and those who believe to ask forgiveness for the polytheists, even if they are relatives, after it has become clear to them that they are the companions of Hellfire. And Ibrahim's asking forgiveness for his father was only because of a promise he had made to him. But when it became clear to him that he was an enemy of Allah, he disassociated from him. Indeed, Ibrahim was compassionate and forbearing."
Numbering
Jami al-Kamil 12518 (2nd edition)
Azami 12518