It is narrated from Sayyiduna Ali (may Allah be pleased with him) that he came to the Prophet (peace and blessings be upon him) and said: "Abu Talib has died." He (peace and blessings be upon him) said: "Go and bury him." He said: "He died as an idolater (mushrik)." He (peace and blessings be upon him) said (again): "Go and bury him." (Sayyiduna Ali (may Allah be pleased with him) said:) "Then when I had buried him and came back to him (peace and blessings be upon him), he (peace and blessings be upon him) said: 'Take a ritual bath (ghusl).'"
This is how Imam al-Nasa'i (may Allah have mercy on him) recorded it,
and Sufyan al-Thawri (may Allah have mercy on him) narrated it from Abu Ishaq (may Allah have mercy on him).