Musnad Ahmad 95
It was narrated that 'Abdullah bin 'Abbas said:
I heard 'Umar bin al-Khattab say: When ‘Abdullah bin Ubayy died, the Messenger of Allah ﷺ was called to offer the funeral prayer for him, and when he stood by the deceased and was about to offer the prayer for him. I went and stood before him and said: O Messenger of Allah, (will you offer the funeral prayer) for the enemy of Allah who said such and such? and I listed what he had done. And the Messenger of Allah ﷺ was smiling until when I had said too much, he said: `Move away from me, O ‘Umar, for I was given the choice and I have chosen. It was said: `Whether you (O Muhammad) ask forgiveness for them (hypocrites) or ask not forgiveness for them- (and even) if you ask seventy times for their forgiveness-Allah will not forgive them' [at-Tawbah 9:80]. If I knew that by asking for forgiveness more than seventy times they would be forgiven, I would have done that.` He said: Then he offered the funeral prayer for him, and walked with him (his bier), and stood by his grave until the burial was completed. He said: I was astounded that I had spoken so audaciously to the Messenger of Allah ﷺ; Allah and His Messenger know best. By Allah, it was not long before these two verses were revealed: “And never (O Muhammad pray (funeral prayer) for any of them (hypocrites) who dies, nor stand at his grave. Certainly they disbelieved in Allah and His Messenger, and died while they were Fasiqoon (rebellious, - disobedient to AIlah and His Messenger).`[at-Tawbah9:84]. So after that the Messenger of Allah ﷺ did not offer the funeral prayer for any hypocrite or stand by his grave until he passed away.
حَدَّثَنَا يَعْقُوبُ، حَدَّثَنَا أَبِي، عَنِ ابْنِ إِسْحَاقَ، حَدَّثَنِي الزُّهْرِيُّ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ بْنِ عُتْبَةَ بْنِ مَسْعُودٍ، عَنْ عَبْدِ اللَّهِ بْنِ عَبَّاسٍ، رَضِيَ اللَّهُ عَنْهُمَا قَالَ سَمِعْتُ عُمَرَ بْنَ الْخَطَّابِ، رَضِيَ اللَّهُ عَنْهُ يَقُولُ لَمَّا تُوُفِّيَ عَبْدُ اللَّهِ بْنُ أُبَيٍّ دُعِيَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ لِلصَّلَاةِ عَلَيْهِ فَقَامَ إِلَيْهِ فَلَمَّا وَقَفَ عَلَيْهِ يُرِيدُ الصَّلَاةَ تَحَوَّلْتُ حَتَّى قُمْتُ فِي صَدْرِهِ فَقُلْتُ يَا رَسُولَ اللَّهِ أَعَلَى عَدُوِّ اللَّهِ عَبْدِ اللَّهِ بْنِ أُبَيٍّ الْقَائِلِ يَوْمَ كَذَا كَذَا وَكَذَا يُعَدِّدُ أَيَّامَهُ قَالَ وَرَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَتَبَسَّمُ حَتَّى إِذَا أَكْثَرْتُ عَلَيْهِ قَالَ أَخِّرْ عَنِّي يَا عُمَرُ إِنِّي خُيِّرْتُ فَاخْتَرْتُ وَقَدْ قِيلَ اسْتَغْفِرْ لَهُمْ أَوْ لَا تَسْتَغْفِرْ لَهُمْ إِنْ تَسْتَغْفِرْ لَهُمْ سَبْعِينَ مَرَّةً فَلَنْ يَغْفِرَ اللَّهُ لَهُمْ لَوْ أَعْلَمُ أَنِّي إِنْ زِدْتُ عَلَى السَّبْعِينَ غُفِرَ لَهُ لَزِدْتُ قَالَ ثُمَّ صَلَّى عَلَيْهِ وَمَشَى مَعَهُ فَقَامَ عَلَى قَبْرِهِ حَتَّى فُرِغَ مِنْهُ قَالَ فَعَجَبٌ لِي وَجَرَاءَتِي عَلَى رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَاللَّهُ وَرَسُولُهُ أَعْلَمُ قَالَ فَوَاللَّهِ مَا كَانَ إِلَّا يَسِيرًا حَتَّى نَزَلَتْ هَاتَانِ الْآيَتَانِ ‏{‏وَلَا تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا وَلَا تَقُمْ عَلَى قَبْرِهِ إِنَّهُمْ كَفَرُوا بِاللَّهِ وَرَسُولِهِ وَمَاتُوا وَهُمْ فَاسِقُونَ‏}‏ فَمَا صَلَّى رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بَعْدَهُ عَلَى مُنَافِقٍ وَلَا قَامَ عَلَى قَبْرِهِ حَتَّى قَبَضَهُ اللَّهُ عَزَّ وَجَلَّ‏.‏