Sunan Ibn Majah, Volume 2, Book 6, Hadith 1491 (DarusSalam) ⓘ
It was narrated that Anas bin Malik said: “A funeral (procession) passed by the Prophet and they praised (the deceased) and spoke well of him. He said: ‘(Paradise is) guaranteed for him.’ Then another funeral passed by and they spoke badly of him, and he (the Prophet) said: ‘(Hell is) guaranteed for him.’ It was said: ‘O Messenger of Allah, you said that (Paradise was) guaranteed for this one and that (Hell was) guaranteed for the other one.’ He said: ‘It is the testimony of the people, and the believers are the witnesses of Allah on earth.’”
حَدَّثَنَا أَحْمَدُ بْنُ عَبْدَةَ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ ثَابِتٍ، عَنْ أَنَسِ بْنِ مَالِكٍ، قَالَ مُرَّ عَلَى النَّبِيِّ ـ صلى الله عليه وسلم ـ بِجِنَازَةٍ فَأُثْنِيَ عَلَيْهَا خَيْرًا فَقَالَ " وَجَبَتْ " . ثُمَّ مُرَّ عَلَيْهِ بِجِنَازَةٍ فَأُثْنِيَ عَلَيْهَا شَرًّا فَقَالَ " وَجَبَتْ " . فَقِيلَ يَا رَسُولَ اللَّهِ قُلْتَ لِهَذِهِ وَجَبَتْ وَلِهَذِهِ وَجَبَتْ فَقَالَ " شَهَادَةُ الْقَوْمِ وَالْمُؤْمِنُونَ شُهُودُ اللَّهِ فِي الأَرْضِ " .
also referenced under: Hadith 1491 (Reference) & Book 6, Hadith 1558 (In-Book)