“When ‘Abdullah bin Ubayy died, his son came to the Prophet ﷺ and said: ‘O Messenger of Allah, give me your shirt so that I may shroud him in it.’ The Messenger of Allah ﷺ said: ‘Notify me when he is ready (i.e., when he has been washed and shrouded).’ When the Prophet ﷺ wanted to offer the funeral prayer for him: ‘You should not do that.’ The Prophet ﷺ offered the funeral prayer for him, and the Prophet ﷺ said to him: ‘I have been given two choices: “...ask forgiveness for them (hypocrites) or ask not forgiveness for them...’” [9:80] Then Allah revealed: ‘And never pray (the funeral prayer) for any of them (hypocrites) who dies, nor stand at his grave.’” [9:84]
لَمَّا تُوُفِّيَ عَبْدُ اللَّهِ بْنُ أُبَىٍّ جَاءَ ابْنُهُ إِلَى النَّبِيِّ ﷺ فَقَالَ يَا رَسُولَ اللَّهِ أَعْطِنِي قَمِيصَكَ أُكَفِّنْهُ فِيهِ فَقَالَ رَسُولُ اللَّهِ ﷺ آذِنُونِي بِهِ فَلَمَّا أَرَادَ النَّبِيُّ ﷺ أَنْ يُصَلِّيَ عَلَيْهِ قَالَ لَهُ عُمَرُ بْنُ الْخَطَّابِ مَا ذَاكَ لَكَ فَصَلَّى عَلَيْهِ النَّبِيُّ ﷺ فَقَالَ لَهُ النَّبِيُّ ﷺ أَنَا بَيْنَ خِيرَتَيْنِ {اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ } فَأَنْزَلَ اللَّهُ سُبْحَانَهُ {وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا وَلاَ تَقُمْ عَلَى قَبْرِهِ}