Ali bin Abu Talib reported,

I heard a man asking forgiveness for his parents, both of whom were polytheists, so I said, "Do you ask forgiveness for them when they are polytheists?"He replied, "Did Ibrahim not ask forgiveness for his father?"I went to the Prophet ﷺ and mentioned this to him, and then the verse was revealed, "And Ibrahim's asking forgiveness for his father was only because of a promise he had made to him" [Tawba 9:114].

Azami 3744

Hasan

عن علي بن أبي طالب، قال

سمعت رجلا يستغفر لأبويه وهما مشركان، فقلت: أتستغفر لهما وهما مشركان؟ فقال: أو لم يستغفر إبراهيم لأبيه، فأتيت النبي ﷺ فذكرت ذلك له فنزلت: {وما كان استغفار إبراهيم لأبيه إلا عن موعدة وعدها إياه} [التوبة: ١١٤].

الأعظمي 3744حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Prayer over the deceased
Section
Prohibition of praying over hypocrites and polytheists and seeking forgiveness for them
Numbering
Jami al-Kamil 3744 (2nd edition)
Azami 3744