عَنِ ابْنِ عُمَرَ رَضِيَ اللَّهُ عَنْهُمَا قَالَ لَمَّا مَاتَ عَبْدُ اللَّهِ بْنُ أُبَيٍّ جَاءَ ابْنُهُ إِلَى رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ فَقَالَ يَا رَسُولَ اللَّهِ أَعْطِنِي قَمِيصَكَ حَتَّى أُكَفِّنَهُ فِيهِ وَصَلِّ عَلَيْهِ وَاسْتَغْفِرْ لَهُ فَأَعْطَاهُ قَمِيصَهُ وَقَالَ آذِنِّي بِهِ فَلَمَّا ذَهَبَ لِيُصَلِّيَ عَلَيْهِ قَالَ يَعْنِي عُمَرَ رَضِيَ اللَّهُ عَنْهُ قَدْ نَهَاكَ اللَّهُ أَنْ تُصَلِّيَ عَلَى الْمُنَافِقِينَ فَقَالَ أَنَا بَيْنَ خِيَرَتَيْنِ اسْتَغْفِرْ لَهُمْ أَوْ لَا تَسْتَغْفِرْ لَهُمْ [سورة التوبة: ٨٠] فَصَلَّى عَلَيْهِ فَأَنْزَلَ اللَّهُ تَعَالَى وَلَا تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا [سورة التوبة: ٨٤] قَالَ فَتُرِكَتْ الصَّلَاةُ عَلَيْهِمْ
It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that when Abdullah bin Ubayy, the hypocrite, died, his son Sayyiduna Abdullah (may Allah be pleased with him), who was a Muslim, came to the Noble Prophet (peace and blessings be upon him) and said: O Messenger of Allah! Grant me your shirt so that I may shroud my father in it, and lead his funeral prayer, and seek forgiveness for him. The Prophet (peace and blessings be upon him) gave him his shirt and said: Inform me at the time (of the funeral). When the Prophet (peace and blessings be upon him) stepped forward to lead the prayer, Sayyiduna Umar (may Allah be pleased with him) said: Allah Almighty has forbidden you from performing the funeral prayer for the hypocrites. The Prophet (peace and blessings be upon him) replied: I have been given a choice; Allah Almighty has said: Whether you seek forgiveness for them or do not seek forgiveness for them. So the Prophet (peace and blessings be upon him) led the funeral prayer, and then Allah Almighty revealed this command: {وَلَا تُصَلِّ عَلَی أَ حَدٍ مِنْہُمْ مَاتَ أَ بَدًا} … And never pray the funeral prayer for any of them ever.