Messenger of Allah, are you going to conduct prayer for this man, whereas Allah has forbidden you to offer prayer for him? Thereupon Messenger of Allah ( ﷺ) said: Allah has given me an option as He has said:" You may beg pardon for them or you may not beg pardon for them, and even if you beg pardon for them, seventy times" (ix. 80), and I am going to make an addition to the seventy. He was a hypocrite and Messenger of Allah ( ﷺ) offered prayer for him and Allah, the Exalted and Glorious, revealed this verse:" Do not offer prayer for any one of them at all and do not stand upon their graves for (offering prayer over them)" (ix. 84).
لَمَّا تُوُفِّيَ عَبْدُ اللَّهِ بْنُ أُبَىٍّ ابْنُ سَلُولَ جَاءَ ابْنُهُ عَبْدُ اللَّهِ بْنُ عَبْدِ اللَّهِ إِلَى رَسُولِ اللَّهِ ﷺ فَسَأَلَهُ أَنْ يُعْطِيَهُ قَمِيصَهُ يُكَفِّنُ فِيهِ أَبَاهُ فَأَعْطَاهُ ثُمَّ سَأَلَهُ أَنْ يُصَلِّيَ عَلَيْهِ فَقَامَ رَسُولُ اللَّهِ ﷺ لِيُصَلِّيَ عَلَيْهِ فَقَامَ عُمَرُ فَأَخَذَ بِثَوْبِ رَسُولِ اللَّهِ ﷺ فَقَالَ يَا رَسُولَ اللَّهِ أَتُصَلِّي عَلَيْهِ وَقَدْ نَهَاكَ اللَّهُ أَنْ تُصَلِّيَ عَلَيْهِ فَقَالَ رَسُولُ اللَّهِ ﷺ إِنَّمَا خَيَّرَنِي اللَّهُ فَقَالَ اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ إِنْ تَسْتَغْفِرْ لَهُمْ سَبْعِينَ مَرَّةً وَسَأَزِيدُهُ عَلَى سَبْعِينَ قَالَ إِنَّهُ مُنَافِقٌ فَصَلَّى عَلَيْهِ رَسُولُ اللَّهِ ﷺ فَأَنْزَلَ اللَّهُ ﷻ { وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا وَلاَ تَقُمْ عَلَى قَبْرِهِ}