He came to the Prophet ﷺ and said, "Abu Talib has died."The Prophet ﷺ said, "Go and bury him."He said, "He died as a polytheist."The Prophet ﷺ said, "Go and bury him."When I had buried him, I returned to him, and he said to me, "Perform a ghusl."
أخبرنا محمد بن المثنى عن محمد قال حدثني شعبة عن أبي إسحق قال سمعت ناجية بن كعب
أنه أتى النبي ﷺ فقال إن أبا طالب مات فقال اذهب فواره قال إنه مات مشركا قال اذهب فواره فلما واريته رجعت إليه فقال لي اغتسل
Its chain is hasan. Abu Dawud narrated it in Al-Janaiz, the chapter titled "A Man Whose Relative Who Is a Polytheist Dies," hadith 3214, from the hadith of Abu Ishaq through this route, and it is also found in Al-Kubra, hadith 195.