"I heard a man seeking forgiveness for his parents who were idolaters, so I said to him: 'You seek forgiveness for your parents while they are idolaters?' He said: 'Did Ibrahim not seek forgiveness for his father, and he was an idolater?' So I mentioned that to the Prophet ﷺ and (the following) was revealed: It is not for the Prophet nor those who believe, that they should seek forgiveness for the idolaters (9:113)."
سَمِعْتُ رَجُلاً يَسْتَغْفِرُ لأَبَوَيْهِ وَهُمَا مُشْرِكَانِ فَقُلْتُ لَهُ أَتَسْتَغْفِرُ لأَبَوَيْكَ وَهُمَا مُشْرِكَانِ فَقَالَ أَوَلَيْسَ اسْتَغْفَرَ إِبْرَاهِيمُ لأَبِيهِ وَهُوَ مُشْرِكٌ فَذَكَرْتُ ذَلِكَ لِلنَّبِيِّ ﷺ فَنَزَلَتْ ( مَا كَانَ لِلنَّبِيِّ وَالَّذِينَ آمَنُوا أَنْ يَسْتَغْفِرُوا لِلْمُشْرِكِينَ )