Ali bin Abu Talib reported,

Ubayy reported, "I heard a man seeking forgiveness for his parents, who were both polytheists, so I said to him, 'Are you seeking forgiveness for them when they are polytheists?'He replied, 'Did Ibrahim not seek forgiveness for his father?'So I went to the Prophet ﷺ and mentioned this to him, and the verse was revealed, 'And Ibrahim's request for forgiveness for his father was only because of a promise he had made to him' [Tawbah 9:114]."

Azami 12522

Hasan

عن علي قال

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

الأعظمي 12522حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "It is not for the Prophet and those who believe to ask forgiveness for the polytheists, even if they are relatives, after it has become clear to them that they are the companions of Hellfire. And Ibrahim's asking forgiveness for his father was only because of a promise he had made to him. But when it became clear to him that he was an enemy of Allah, he disassociated from him. Indeed, Ibrahim was compassionate and forbearing."
Numbering
Jami al-Kamil 12522 (2nd edition)
Azami 12522