Musayab bin Hazn reported,

When Abu Talib was on the verge of death, the Prophet ﷺ came to him while Abu Jahl and Abdullah bin Abu Umaya were with him. The Prophet ﷺ said, "Uncle, say, 'There is no god but Allah,' a statement with which I will plead on your behalf before Allah."Abu Jahl and Abdullah bin Ubayy bin Khalaf said, "Abu Talib, will you turn away from the religion of Abdul Muttalib?"The Prophet ﷺ said, "I will surely seek forgiveness for you as long as I am not forbidden to do so."Then the following verse was revealed, "It is not for the Prophet and those who have believed to ask forgiveness for the polytheists, even if they were relatives, after it has become clear to them that they are companions of Hellfire." [Tawba 9:113]

Azami 146

Sahih

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

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

الأعظمي 146صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
Evidence for the validity of embracing Islam for one who is dying, as long as the death throes have not begun
Numbering
Jami al-Kamil 146 (2nd edition)
Azami 146