Sunan an-Nasa'i, Book 21, Hadith 117 (In-Book) ⓘ
It was narrated that Abu Hurairah said: "A funeral passed by the Prophet and they praised (the deceased). The Prophet said: 'It is granted.' Then another funeral passed by and they criticized (the deceased). The Prophet said: 'It is granted.' They said: 'O Messenger of Allah, you said in both cases, 'It is granted?' The Prophet said: 'The angels are the witnesses of Allah in heaven, and you are the witnesses of Allah on Earth."'
أَخْبَرَنَا مُحَمَّدُ بْنُ بَشَّارٍ، قَالَ حَدَّثَنَا هِشَامُ بْنُ عَبْدِ الْمَلِكِ، قَالَ حَدَّثَنَا شُعْبَةُ، قَالَ سَمِعْتُ إِبْرَاهِيمَ بْنَ عَامِرٍ، وَجَدُّهُ، أُمَيَّةُ بْنُ خَلَفٍ قَالَ سَمِعْتُ عَامِرَ بْنَ سَعْدٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ مَرُّوا بِجَنَازَةٍ عَلَى النَّبِيِّ صلى الله عليه وسلم فَأَثْنَوْا عَلَيْهَا خَيْرًا فَقَالَ النَّبِيُّ صلى الله عليه وسلم " وَجَبَتْ " . ثُمَّ مَرُّوا بِجَنَازَةٍ أُخْرَى فَأَثْنَوْا عَلَيْهَا شَرًّا فَقَالَ النَّبِيُّ صلى الله عليه وسلم " وَجَبَتْ " . قَالُوا يَا رَسُولَ اللَّهِ قَوْلُكَ الأُولَى وَالأُخْرَى " وَجَبَتْ " . فَقَالَ النَّبِيُّ صلى الله عليه وسلم " الْمَلاَئِكَةُ شُهَدَاءُ اللَّهِ فِي السَّمَاءِ وَأَنْتُمْ شُهَدَاءُ اللَّهِ فِي الأَرْضِ " .
also referenced under: Hadith 1933 (Reference) & Volume 3, Book 21, Hadith 1935 (DarusSalam)