The Statement of Allah It is not (proper) for the Prophet (ﷺ) and those who believe to ask for Allahs forgiveness for the Mushrikun [polytheists, pagans, idolaters, and disbelievers in the Oneness of Allah and in His Messenger Muhammad ﷺ] . . .(V.9 :113)

Hadith Number 4675

setting

Narrated Al-Musaiyab

When Abu Talib's death approached, the Prophet (ﷺ) went to him while Abu Jahl and `Abdullah bin Abi Umaiya were present with him. The Prophet (ﷺ) said, "O uncle, say: None has the right to be worshipped except Allah, so that I may argue for your case with it before Allah." On that, Abu Jahl and `Abdullah bin Abu Umaiya said, "O Abu Talib! Do you want to renounce `Abdul Muttalib's religion?" Then the Prophet said, "I will keep on asking (Allah for) forgiveness for you unless I am forbidden to do so." Then there was revealed:-- '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)