Sahih Muslim , Book 31, Hadith 5904 (USC-MSA)

Ibn Umar reported that when 'Abdullah b. Ubayy b. Salul (the hypocrite) died, his son Abdullah b. Abdullah came to Allah's Messenger (may peace be upon -him) and asked him to give his shirt which should be used for the coffin of his father. He gave that to him. Allah's Messenger stood up to say prayer over him Thereupon I Umar caught hold of the clothe of Allah's Messenger and said: Allah's Messenger, are you going to offer prayer, whereas Allah has forbidden to offer prayer for him, whereupon Allah's Messenger said: Allah has given me a choice saying: Ask forgiveness for them or you may not ask for them; even if you ask for them seventy times, I will make an addition to the seventy. He was a hypocrite and Allah's Messenger said prayer over him that Allah, the Exalted and Glorious, revealed the verse:" And never pray over any one of them that has died and never should you stand by his grave" (ix. 84).

حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا أَبُو أُسَامَةَ، حَدَّثَنَا عُبَيْدُ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ لَمَّا تُوُفِّيَ عَبْدُ اللَّهِ بْنُ أُبَىٍّ ابْنُ سَلُولَ جَاءَ ابْنُهُ عَبْدُ اللَّهِ بْنُ عَبْدِ اللَّهِ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَسَأَلَهُ أَنْ يُعْطِيَهُ قَمِيصَهُ أَنْ يُكَفِّنَ فِيهِ أَبَاهُ فَأَعْطَاهُ ثُمَّ سَأَلَهُ أَنْ يُصَلِّيَ عَلَيْهِ فَقَامَ رَسُولُ اللَّهِ صلى الله عليه وسلم لِيُصَلِّيَ عَلَيْهِ فَقَامَ عُمَرُ فَأَخَذَ بِثَوْبِ رَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ يَا رَسُولَ اللَّهِ أَتُصَلِّي عَلَيْهِ وَقَدْ نَهَاكَ اللَّهُ أَنْ تُصَلِّيَ عَلَيْهِ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ إِنَّمَا خَيَّرَنِيَ اللَّهُ فَقَالَ ‏{‏ اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ إِنْ تَسْتَغْفِرْ لَهُمْ سَبْعِينَ مَرَّةً‏}‏ وَسَأَزِيدُ عَلَى سَبْعِينَ ‏"‏ ‏.‏ قَالَ إِنَّهُ مُنَافِقٌ ‏.‏ فَصَلَّى عَلَيْهِ رَسُولُ اللَّهِ صلى الله عليه وسلم وَأَنْزَلَ اللَّهُ عَزَّ وَجَلَّ ‏{‏ وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا وَلاَ تَقُمْ عَلَى قَبْرِهِ‏}‏ ‏.‏

sunnah.com