I heard a man asking for forgiveness for his parents and they were mushrikeen. I said: Are you asking for forgiveness for your parents when they are mushrikeen? He said: Didnʿt Ibraheem (عليه السلام) ask for forgiveness for his father when he was a mushrik? I mentioned that to the Prophet ﷺ and these verses were revealed: “It is not (proper) for the Prophet ﷺ and those who believe to ask Allahʿs forgiveness for the Mushrikeen” [At-Tawbah 9:113-114]. ‘Abdur-Rahman said: And Allah revealed [the words]. “And Ibraheemʿs (Abraham) invoking (of Allah) for his fatherʿs forgiveness was only because of a promise he [Ibraheem (Abraham)] had made to him (his father)ʿ.
سَمِعْتُ رَجُلًا يَسْتَغْفِرُ لِأَبَوَيْهِ وَهُمَا مُشْرِكَانِ فَقُلْتُ تَسْتَغْفِرُ لِأَبَوَيْكَ وَهُمَا مُشْرِكَانِ؟ فَقَالَ أَلَيْسَ قَدِ اسْتَغْفَرَ إِبْرَاهِيمُ لِأَبِيهِ وَهُوَ مُشْرِكٌ؟ قَالَ فَذَكَرْتُ ذَلِكَ لِلنَّبِيِّ ﷺ فَنَزَلَتْ {مَا كَانَ لِلنَّبِيِّ وَالَّذِينَ آمَنُوا أَنْ يَسْتَغْفِرُوا لِلمُشْرِكِينَ} [التوبة 113] إِلَى آخِرِ الْآيَتَيْنِ قَالَ عَبْدُ الرَّحْمَنِ فَأَنْزَلَ اللهُ {وَمَا كَانَ اسْتِغْفَارُ إِبْرَاهِيمَ لِأَبِيهِ إِلا عَنْ مَوْعِدَةٍ وَعَدَهَا إِيَّاهُ} [التوبة 114]