Anas bin Malik reported,

A funeral procession passed by the Prophet ﷺ, and the people praised the deceased with good words. He said, "It has become certain."Then another passed by, and they spoke ill of the deceased, or said something to that effect. He said, "It has become certain."Someone asked, "Messenger of Allah, you said about this one 'It has become certain,' and about that one 'It has become certain'?"He replied, "The testimony of the people. The believers are Allah's witnesses on earth."

Azami 6739

Sahih

عن أنس قال

مر على النبي ﷺ بجنازة فأثنوا عليها خيرا، فقال: وجبت ثم مر بأخرى فأثنوا عليها شرا- أو قال غير ذلك- فقال: وجبت فقيل: يا رسول الله قلت لهذا وجبت ولهذا وجبت؟ قال: شهادة القوما، المؤمنونا شهداء الله في الأرض.

الأعظمي 6739صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Judgeship
Chapter
Testimonies
Section
Believers are the witnesses of Allah on earth
Numbering
Jami al-Kamil 6739 (2nd edition)
Azami 6739