Sahih al-Bukhari 4670
Narrated Ibn Abbas:
When 'Abdullah bin 'Ubai died, his son 'Abdullah bin 'Abdullah came to Allah's Apostle and asked him to give him his shirt in order to shroud his father in it. He gave it to him and then 'Abdullah asked the Prophet to offer the funeral prayer for him (his father). Allah's Apostle got up to offer the funeral prayer for him, but Umar got up too and got hold of the garment of Allah's Apostle and said, "O Allah's Apostle Will you offer the funeral prayer for him though your Lord has forbidden you to offer the prayer for him" Allah's Apostle ﷺ said, "But Allah has given me the choice by saying: '(Whether you) ask forgiveness for them, or do not ask forgiveness for them;
even if you ask forgiveness for them seventy times..' (9.80) so I will ask more than seventy times." 'Umar said, "But he ('Abdullah bin 'Ubai) is a hypocrite!" However, Allah's Apostle did offer the funeral prayer for him whereupon Allah revealed: 'And never (O Muhammad) pray for anyone of them that dies, nor stand at his grave.' (9.84)
حَدَّثَنَا عُبَيْدُ بْنُ إِسْمَاعِيلَ، عَنْ أَبِي أُسَامَةَ، عَنْ عُبَيْدِ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ ـ رضى الله عنهما ـ قَالَ لَمَّا تُوُفِّيَ عَبْدُ اللَّهِ جَاءَ ابْنُهُ عَبْدُ اللَّهِ بْنُ عَبْدِ اللَّهِ إِلَى رَسُولِ اللَّهِ ﷺ فَسَأَلَهُ أَنْ يُعْطِيَهُ قَمِيصَهُ يُكَفِّنُ فِيهِ أَبَاهُ فَأَعْطَاهُ، ثُمَّ سَأَلَهُ أَنْ يُصَلِّيَ عَلَيْهِ، فَقَامَ رَسُولُ اللَّهِ ﷺ لِيُصَلِّيَ فَقَامَ عُمَرُ فَأَخَذَ بِثَوْبِ رَسُولِ اللَّهِ ﷺ فَقَالَ يَا رَسُولَ اللَّهِ تُصَلِّي عَلَيْهِ وَقَدْ نَهَاكَ رَبُّكَ أَنْ تُصَلِّيَ عَلَيْهِ فَقَالَ رَسُولُ اللَّهِ ﷺ " إِنَّمَا خَيَّرَنِي اللَّهُ فَقَالَ اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ إِنْ تَسْتَغْفِرْ لَهُمْ سَبْعِينَ مَرَّةً وَسَأَزِيدُهُ عَلَى السَّبْعِينَ ". قَالَ إِنَّهُ مُنَافِقٌ. قَالَ فَصَلَّى عَلَيْهِ رَسُولُ اللَّهِ ﷺ فَأَنْزَلَ اللَّهُ وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا وَلاَ تَقُمْ عَلَى قَبْرِهِ.