When ʿAbdullah bin Ubdi (bin Salul) died, his son came to Messenger of Allah ﷺ and said ' O Allah's Apostle, give me your shirt so that I may shroud my fathers body in it. And please offer a funeral prayer for him and invoke Allah for his forgiveness." The Prophet ﷺ gave him his shirt and said to him 'Inform us when you finish (and the funeral procession is ready) call us. When he had finished he told the Prophet ﷺ and the Prophet ﷺ proceeded to order his funeral prayers but ʿUmar stopped him and said, "Didn't Allah forbid you to offer the funeral prayer for the hypocrites when He said: "Whether you (O Muhammad) ask forgiveness for them or ask not forgiveness for them: (and even) if you ask forgiveness for them seventy times. Allah will not forgive them." (9.80) Then there was revealed: "And never (O Muhammad) pray for any of them that dies, nor stand at his grave." (9.34) Thenceforth the Prophet ﷺ did not offer funeral prayers for the hypocrites.
لَمَّا تُوُفِّيَ عَبْدُ اللَّهِ بْنُ أُبَىٍّ جَاءَ ابْنُهُ إِلَى رَسُولِ اللَّهِ ﷺ فَقَالَ يَا رَسُولَ اللَّهِ أَعْطِنِي قَمِيصَكَ أُكَفِّنْهُ فِيهِ وَصَلِّ عَلَيْهِ وَاسْتَغْفِرْ لَهُ فَأَعْطَاهُ قَمِيصَهُ وَقَالَ إِذَا فَرَغْتَ فَآذِنَّا فَلَمَّا فَرَغَ آذَنَهُ فَجَاءَ لِيُصَلِّيَ عَلَيْهِ فَجَذَبَهُ عُمَرُ فَقَالَ أَلَيْسَ قَدْ نَهَاكَ اللَّهُ أَنْ تُصَلِّيَ عَلَى الْمُنَافِقِينَ فَقَالَ {اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ إِنْ تَسْتَغْفِرْ لَهُمْ سَبْعِينَ مَرَّةً فَلَنْ يَغْفِرَ اللَّهُ لَهُمْ} فَنَزَلَتْ {وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا} فَتَرَكَ الصَّلاَةَ عَلَيْهِمْ