Sunan an Nasai 1932
The Book of Funerals
أَخْبَرَنِي زِيَادُ بْنُ أَيُّوبَ، قَالَ حَدَّثَنَا إِسْمَاعِيلُ، قَالَ حَدَّثَنَا عَبْدُ الْعَزِيزِ، عَنْ أَنَسٍ، قَالَ مُرَّ بِجَنَازَةٍ فَأُثْنِيَ عَلَيْهَا خَيْرًا فَقَالَ النَّبِيُّ صلى الله عليه وسلم " وَجَبَتْ " . وَمُرَّ بِجَنَازَةٍ أُخْرَى فَأُثْنِيَ عَلَيْهَا شَرًّا فَقَالَ النَّبِيُّ صلى الله عليه وسلم " وَجَبَتْ " . فَقَالَ عُمَرُ فِدَاكَ أَبِي وَأُمِّي مُرَّ بِجَنَازَةِ فَأُثْنِيَ عَلَيْهَا خَيْرًا فَقُلْتَ " وَجَبَتْ " . وَمُرَّ بِجَنَازَةٍ فَأُثْنِيَ عَلَيْهَا شَرًّا فَقُلْتَ " وَجَبَتْ " . فَقَالَ " مَنْ أَثْنَيْتُمْ عَلَيْهِ خَيْرًا وَجَبَتْ لَهُ الْجَنَّةُ وَمَنْ أَثْنَيْتُمْ عَلَيْهِ شَرًّا وَجَبَتْ لَهُ النَّارُ أَنْتُمْ شُهَدَاءُ اللَّهِ فِي الأَرْضِ " .
It was narrated that Anas said:"A funeral passed by and the deceased was praised." The Prophet said: "It is granted." Another funeral passed by and the deceased was criticized. The Prophet said: "It is granted." 'Umar said: "May my father and mother be ransomed for you. One funeral passed by and the deceased was praised, and you said, 'It is granted?"' He said: "Whoever is praised will be granted Paradise, and whoever is criticized will be granted Hell, You are the witnesses of Allah on Earth
Grading: Abu Ghuddah: Sahih · Al-Albani: Sahih · Zubair Ali Zai: Sahih - Agreed Upon
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.