It wasnarrated that Anas bin Malik said:
"A funeral (procession)passedby the Prophet (ﷺ) 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(ﷺ)) 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.'"
English reference: Vol. 1, Book 6, Hadith 1491
Arabic reference: Book 6, Hadith 1558