Musayab bin Hazn reported,

When Abu Talib was on the verge of death, the Prophet ﷺ came in to see him. Abu Jahl and Abdullah bin Abu Umaya were already there with him.The Prophet ﷺ said, "Uncle, say there is no god but Allah, so that I may plead for you with it before Allah."Abu Jahl and Abdullah bin Abu Khalaf said, "Abu Talib, would you turn away from the religion of Abdul-Muttalib?"The Prophet ﷺ then said, "I will keep asking forgiveness for you as long as I am not forbidden to do so."Then this was revealed, "It is not for the Prophet and those who believe to ask forgiveness for the idolaters, even if they are close relatives, after it has become clear to them that they are the companions of the Blaze" [Tawbah 9:113].

Azami 3741

Sahih

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

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

الأعظمي 3741صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Prayer over the deceased
Section
Prohibition of praying over hypocrites and polytheists and seeking forgiveness for them
Numbering
Jami al-Kamil 3741 (2nd edition)
Azami 3741