Bulugh al-Maram 558

Arabic hadith text
وَعَنِ ابْنِ عَبَّاسٍ رَضِيَ اَللَّهُ عَنْهُمَا: سَمِعْتُ اَلنَّبِيَّ ‏- صلى الله عليه وسلم ‏-يَقُولُ: { مَا مِنْ رَجُلٍ مُسْلِمٍ يَمُوتُ, فَيَقُومُ عَلَى جَنَازَتِهِ أَرْبَعُونَ رَجُلًا, لَا يُشْرِكُونَ بِاَللَّهِ شَيْئًا, إِلَّا شَفَّعَهُمْ اَللَّهُ فِيهِ } رَوَاهُ مُسْلِمٌ 1‏ .‏‏1 ‏- حسن.‏ رواه مسلم (948)‏.‏
Translation

Ibn ‘Abbas (RAA) narrated, ‘I heard the Messenger of Allah (ﷺ) say, "If a Muslim man dies and a group of forty people, who do not associate any one with Allah, pray for him, Allah will accept their intercession for him (by way of their Du’A for him.” Related by Muslim.