Musnad Ahmad 771
It was narrated that ‘Ali (رضي الله عنه) said:
I heard a man praying for forgiveness for his parents, who were mushrikeen. I said: Would a man pray for forgiveness for his parents when they are mushrikeen? He said: Didn`t Ibrahim (عليه السلام) pray for forgiveness for his father? I mentioned that to the Prophet (ﷺ) and the words `It is not proper for the Prophet and those who believe to ask Allah`s forgiveness for the Mushrikoon, even though they be of kin, after it has become clear to them that they are the dwellers of the Fire (because they died in a state of disbelief). And Ibrahim`s (Abraham) (عليه السلام) invoking (of Allah) for his father`s forgiveness was only because of a promise he [Ibrahim (Abraham]] had made to him (his father). But when it became clear to him that he (his father) is an enemy of Allah, he dissociated himself from him” At- Tawbah [9:113-114] were revealed. He [the Prophet (ﷺ) ] said: `[That was] when he died.`
حَدَّثَنَا يَحْيَى بْنُ آدَمَ، حَدَّثَنَا سُفْيَانُ، عَنْ أَبِي إِسْحَاقَ، عَنْ أَبِي الْخَلِيلِ، عَنْ عَلِيٍّ، رَضِيَ اللَّهُ عَنْهُ قَالَ سَمِعْتُ رَجُلًا، يَسْتَغْفِرُ لِأَبَوَيْهِ وَهُمَا مُشْرِكَانِ فَقُلْتُ أَيَسْتَغْفِرُ الرَّجُلُ لِأَبَوَيْهِ وَهُمَا مُشْرِكَانِ فَقَالَ أَوَلَمْ يَسْتَغْفِرْ إِبْرَاهِيمُ لِأَبِيهِ فَذَكَرْتُ ذَلِكَ لِلنَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَنَزَلَتْ ‏{‏مَا كَانَ لِلنَّبِيِّ وَالَّذِينَ آمَنُوا أَنْ يَسْتَغْفِرُوا لِلْمُشْرِكِينَ‏}‏ إِلَى قَوْلِهِ ‏{‏تَبَرَّأَ مِنْهُ‏}‏ قَالَ لَمَّا مَاتَ فَلَا أَدْرِي قَالَهُ سُفْيَانُ أَوْ قَالَهُ إِسْرَائِيلُ أَوْ هُوَ فِي الْحَدِيثِ لَمَّا مَاتَ‏.‏