So I went out and I informed him about the people who had gathered there. He (Ibn 'Abbas) said: Do you think they are forty? He (Kuraib) said: Yes. Ibn 'Abbas then said to them: Bring him (the dead body) out for I have heard Messenger of Allah ﷺ as saying: If any Muslim dies and forty men who associate nothing with Allah stand over his prayer (they offer prayer over him), Allah will accept them as intercessors for him.
يَا كُرَيْبُ انْظُرْ مَا اجْتَمَعَ لَهُ مِنَ النَّاسِ قَالَ فَخَرَجْتُ فَإِذَا نَاسٌ قَدِ اجْتَمَعُوا لَهُ فَأَخْبَرْتُهُ فَقَالَ تَقُولُ هُمْ أَرْبَعُونَ قَالَ نَعَمْ قَالَ أَخْرِجُوهُ فَإِنِّي سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ مَا مِنْ رَجُلٍ مُسْلِمٍ يَمُوتُ فَيَقُومُ عَلَى جَنَازَتِهِ أَرْبَعُونَ رَجُلاً لاَ يُشْرِكُونَ بِاللَّهِ شَيْئًا إِلاَّ شَفَّعَهُمُ اللَّهُ فِيهِ وَفِي رِوَايَةِ ابْنِ مَعْرُوفٍ عَنْ شَرِيكِ بْنِ أَبِي نَمِرٍ عَنْ كُرَيْبٍ عَنِ ابْنِ عَبَّاسٍ