Sahih al-Bukhari 2642
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ ثَابِتٍ، عَنْ أَنَسٍ ـ رضى الله عنه ـ قَالَ مُرَّ عَلَى النَّبِيِّ صلى الله عليه وسلم بِجَنَازَةٍ، فَأَثْنَوْا عَلَيْهَا خَيْرًا فَقَالَ وَجَبَتْ ". ثُمَّ مُرَّ بِأُخْرَى فَأَثْنَوْا عَلَيْهَا شَرًّا ـ أَوْ قَالَ غَيْرَ ذَلِكَ ـ فَقَالَ " وَجَبَتْ ". فَقِيلَ يَا رَسُولَ اللَّهِ، قُلْتَ لِهَذَا وَجَبَتْ، وَلِهَذَا وَجَبَتْ، قَالَ " شَهَادَةُ الْقَوْمِ، الْمُؤْمِنُونَ شُهَدَاءُ اللَّهِ فِي الأَرْضِ "."
Narrated Anas:
A funeral procession passed in front of the Prophet (ﷺ) and the people praised the deceased. The Prophet (ﷺ) said, "It has been affirmed (Paradise)." Then another funeral procession passed by and the people talked badly of the deceased. The Prophet (ﷺ) said, "It has been affirmed (Hell)." Allah's Messenger (ﷺ) was asked, "O Allah's Messenger (ﷺ)! You said it has been affirmed for both?" The Prophet (ﷺ) said, "The testimony of the people (is accepted), (for) the believer are Allah's witnesses on the earth."
Full reference and source
Sahih al-Bukhari 2642 In-book : Book 52, Hadith 6 USC-MSA web (English) : Vol. 3, Book 48, Hadith 810 (deprecated)
View source on Sunnah.com (opens in a new tab)