Sahih al-Bukhari, Volume 7, Book 72, Hadith 688 (USC-MSA) ⓘ
Narrated `Abdullah bin `Umar: When `Abdullah bin Ubdi (bin Salul) died, his son came to Allah's Messenger 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.
حَدَّثَنَا صَدَقَةُ، أَخْبَرَنَا يَحْيَى بْنُ سَعِيدٍ، عَنْ عُبَيْدِ اللَّهِ، قَالَ أَخْبَرَنِي نَافِعٌ، عَنْ عَبْدِ اللَّهِ، قَالَ لَمَّا تُوُفِّيَ عَبْدُ اللَّهِ بْنُ أُبَىٍّ جَاءَ ابْنُهُ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ يَا رَسُولَ اللَّهِ أَعْطِنِي قَمِيصَكَ أُكَفِّنْهُ فِيهِ، وَصَلِّ عَلَيْهِ، وَاسْتَغْفِرْ لَهُ، فَأَعْطَاهُ قَمِيصَهُ، وَقَالَ " إِذَا فَرَغْتَ فَآذِنَّا ". فَلَمَّا فَرَغَ آذَنَهُ، فَجَاءَ لِيُصَلِّيَ عَلَيْهِ، فَجَذَبَهُ عُمَرُ فَقَالَ أَلَيْسَ قَدْ نَهَاكَ اللَّهُ أَنْ تُصَلِّيَ عَلَى الْمُنَافِقِينَ فَقَالَ {اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ إِنْ تَسْتَغْفِرْ لَهُمْ سَبْعِينَ مَرَّةً فَلَنْ يَغْفِرَ اللَّهُ لَهُمْ}. فَنَزَلَتْ {وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا} فَتَرَكَ الصَّلاَةَ عَلَيْهِمْ.
also referenced under: Book 77, Hadith 14 (In-Book) & Hadith 5796 (DarusSalam)