Anas bin Malik reported,

A funeral procession passed by the Messenger of Allah ﷺ, and the people spoke well of the deceased. He said, "It is confirmed, it is confirmed."Then another funeral procession passed by, and the people spoke ill of the deceased. He said, "It is confirmed, it is confirmed."Umar asked, "Messenger of Allah, what did you mean by saying 'It is confirmed' the first time, and 'It is confirmed' the second time?"He replied, "As for the first, the people spoke well of him, so I said Paradise has been confirmed for him. As for the second, the people spoke ill of him, so I said the Fire has been confirmed for him. You are Allah's witnesses on His earth."

Ahmad 13996

Sahih

حدثنا محمد بن جعفر حدثنا شعبة عن عبد العزيز بن صهيب

عن أنس بن مالك

أن رسول الله ﷺ مرت عليه جنازة فأثنوا عليها خيرا فقال وجبت وجبت ومرت عليه جنازة فأثنوا عليها شرا فقال وجبت وجبت فقال عمر يا رسول الله قولك الأول وجبت وقولك الآخر وجبت قال أما الأول فأثنوا عليها خيرا فقلت وجبت له الجنة وأما الآخر فأثنوا عليها شرا فقلت وجبت له النار وأنتم شهداء الله في أرضه

أحمد 13996صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 13996
Ahmad 13996