حَدَّثَنَا أَحْمَدُ بْنُ عَبْدَةَ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ ثَابِتٍ، عَنْ أَنَسِ بْنِ مَالِكٍ، قَالَ مُرَّ عَلَى النَّبِيِّ ـ صلى الله عليه وسلم ـ بِجِنَازَةٍ فَأُثْنِيَ عَلَيْهَا خَيْرًا فَقَالَ ‏"‏ وَجَبَتْ ‏"‏ ‏.‏ ثُمَّ مُرَّ عَلَيْهِ بِجِنَازَةٍ فَأُثْنِيَ عَلَيْهَا شَرًّا فَقَالَ ‏"‏ وَجَبَتْ ‏"‏ ‏.‏ فَقِيلَ يَا رَسُولَ اللَّهِ قُلْتَ لِهَذِهِ وَجَبَتْ وَلِهَذِهِ وَجَبَتْ فَقَالَ ‏"‏ شَهَادَةُ الْقَوْمِ وَالْمُؤْمِنُونَ شُهُودُ اللَّهِ فِي الأَرْضِ ‏"‏ ‏.‏

It wasnarrated that Anas bin Malik said: “A funeral (procession)passedby the Prophet (PBUH) and they praised (the deceased) and spokewellof him. He said: ‘(Paradise is) guaranteed for him.’ Then anotherfuneral passed by and they spoke badly of him, and he (the Prophet(PBUH)) said: ‘(Hell is) guaranteed for him.’ It was said: ‘OMessengerof Allah, you said that (Paradise was) guaranteed for thisone andthat (Hell was) guaranteed for the other one.’ He said: ‘Itis thetestimony of the people, and the believers are the witnessesof Allahon earth.’” Translation Not Available

Book Ref: Sunan Ibn Majah Book 6 Hadith 1491
Web Ref:  Sunan Ibn Majah Vol 1 Book 6 Hadith 1491