When the time of the death of Abu Talib approached, Messenger of Allah ﷺ went to him and found Abu Jahl bin Hisham and ʿAbdullah bin Abi Umaiya bin Al-Mughira by his side. Messenger of Allah ﷺ said to Abu Talib, "O uncle! Say: None has the right to be worshipped but Allah, a sentence with which I shall be a witness (i.e. argue) for you before Allah. Abu Jahl and ʿAbdullah bin Abi Umaiya said, "O Abu Talib! Are you going to denounce the religion of ʿAbdul Muttalib?" Messenger of Allah ﷺ kept on inviting Abu Talib to say it (i.e. 'None has the right to be worshipped but Allah') while they (Abu Jahl and ʿAbdullah) kept on repeating their statement till Abu Talib said as his last statement that he was on the religion of ʿAbdul Muttalib and refused to say, 'None has the right to be worshipped but Allah.' (Then Messenger of Allah ﷺ said, "I will keep on asking Allah's forgiveness for you unless I am forbidden (by Allah) to do so." So Allah revealed (the verse) concerning him (i.e. It is not fitting for the Prophet ﷺ and those who believe that they should invoke (Allah) for forgiveness for pagans even though they be of kin, after it has become clear to them that they are companions of the fire (9.113).
أَنَّهُ لَمَّا حَضَرَتْ أَبَا طَالِبٍ الْوَفَاةُ جَاءَهُ رَسُولُ اللَّهِ ﷺ فَوَجَدَ عِنْدَهُ أَبَا جَهْلِ بْنَ هِشَامٍ وَعَبْدَ اللَّهِ بْنَ أَبِي أُمَيَّةَ بْنِ الْمُغِيرَةِ قَالَ رَسُولُ اللَّهِ ﷺ لأَبِي طَالِبٍ يَا عَمِّ قُلْ لاَ إِلَهَ إِلاَّ اللَّهُ كَلِمَةً أَشْهَدُ لَكَ بِهَا عِنْدَ اللَّهِ فَقَالَ أَبُو جَهْلٍ وَعَبْدُ اللَّهِ بْنُ أَبِي أُمَيَّةَ يَا أَبَا طَالِبٍ أَتَرْغَبُ عَنْ مِلَّةِ عَبْدِ الْمُطَّلِبِ فَلَمْ يَزَلْ رَسُولُ اللَّهِ ﷺ يَعْرِضُهَا عَلَيْهِ وَيَعُودَانِ بِتِلْكَ الْمَقَالَةِ حَتَّى قَالَ أَبُو طَالِبٍ آخِرَ مَا كَلَّمَهُمْ هُوَ عَلَى مِلَّةِ عَبْدِ الْمُطَّلِبِ وَأَبَى أَنْ يَقُولَ لاَ إِلَهَ إِلاَّ اللَّهُ فَقَالَ رَسُولُ اللَّهِ ﷺ أَمَا وَاللَّهِ لأَسْتَغْفِرَنَّ لَكَ مَا لَمْ أُنْهَ عَنْكَ فَأَنْزَلَ اللَّهُ تَعَالَى فِيهِ {مَا كَانَ لِلنَّبِيِّ} الآيَةَ