When ʿAbdullah bin Ubai bin Salul died, Messenger of Allah ﷺ was called in order to offer the funeral prayer for him. When Messenger of Allah ﷺ got up (to offer the prayer) I jumped towards him and said, "O Messenger of Allah ﷺ! Do you offer the prayer for Ibn Ubai although he said so-and-so on such-and-such-a day?" I went on mentioning his sayings. Messenger of Allah ﷺ smiled and said, "Keep away from me, O ʿUmar!" But when I spoke too much to him, he said, "I have been given the choice, and I have chosen (this) ; and if I knew that if I asked forgiveness for him more than seventy times, he would be for given, I would ask it for more times than that." So Messenger of Allah ﷺ offered the funeral prayer for him and then left, but he did not stay long before the two Verses of Surat-Bara'a were revealed, i.e.:-- 'And never (O Muhammad) pray for anyone of them that dies.... and died in a state of rebellion.' (9.84) Later I was astonished at my daring to speak like that to Messenger of Allah ﷺ and Allah and His Apostle know best.
أَنَّهُ قَالَ لَمَّا مَاتَ عَبْدُ اللَّهِ بْنُ أُبَىٍّ ابْنُ سَلُولَ دُعِيَ لَهُ رَسُولُ اللَّهِ ﷺ لِيُصَلِّيَ عَلَيْهِ فَلَمَّا قَامَ رَسُولُ اللَّهِ ﷺ وَثَبْتُ إِلَيْهِ فَقُلْتُ يَا رَسُولَ اللَّهِ أَتُصَلِّي عَلَى ابْنِ أُبَىٍّ وَقَدْ قَالَ يَوْمَ كَذَا كَذَا وَكَذَا قَالَ أُعَدِّدُ عَلَيْهِ قَوْلَهُ فَتَبَسَّمَ رَسُولُ اللَّهِ ﷺ وَقَالَ أَخِّرْ عَنِّي يَا عُمَرُ فَلَمَّا أَكْثَرْتُ عَلَيْهِ قَالَ إِنِّي خُيِّرْتُ فَاخْتَرْتُ لَوْ أَعْلَمُ أَنِّي إِنْ زِدْتُ عَلَى السَّبْعِينَ يُغْفَرْ لَهُ لَزِدْتُ عَلَيْهَا قَالَ فَصَلَّى عَلَيْهِ رَسُولُ اللَّهِ ﷺ ثُمَّ انْصَرَفَ فَلَمْ يَمْكُثْ إِلاَّ يَسِيرًا حَتَّى نَزَلَتِ الآيَتَانِ مِنْ بَرَاءَةَ {وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا} إِلَى قَوْلِهِ {وَهُمْ فَاسِقُونَ} قَالَ فَعَجِبْتُ بَعْدُ مِنْ جُرْأَتِي عَلَى رَسُولِ اللَّهِ ﷺ وَاللَّهُ وَرَسُولُهُ أَعْلَمُ