A funeral procession passed by the Prophet ﷺ, and the deceased was praised with good qualities and noble deeds. He said, "It is confirmed."Then another funeral passed by, and the deceased was spoken of with evil qualities and wicked deeds. He said, "It is confirmed. You are Allah's witnesses on earth."
مر على النبي ﷺ بجنازة فأثني عليها خيرا في مناقب الخير فقال: وجبت ثم مروا عليها بأخرى، فأثني عليها شرا في مناقب الشر فقال: وجبت إنكم شداء الله في الأرض.
Ibn Majah (1492) narrated it from Abu Bakr bin Abu Shayba, who said, "Ali bin Mushir told us, from Muhammad bin Amr, from Abu Salama, from Abu Hurairah," and he related the hadith. Ibn Hibban graded it sahih (3024), and Imam Ahmad narrated it (7552), both of them via Muhammad bin Amr with his chain. Its chain is hasan because of Muhammad bin Amr, who is Laythi, for his hadith is hasan.Abu Dawud (3233) and Nasai (1933) narrated it, both via Shuba, from Ibrahim bin Amir, from Amir bin Saad, from Abu Hurairah, who said, "They passed by the Messenger of Allah ﷺ with a funeral bier and praised the deceased well, so he said, 'It is confirmed.' Then they passed by another and spoke ill of the deceased, so he said, 'It is confirmed.' Then he said, 'You are witnesses over one another.'" And in Nasai's wording, "The angels are witnesses of Allah in heaven, and you are witnesses of Allah on earth."Imam Ahmad narrated it (10013) via Sufyan and Masaar, from Ibrahim bin Amir bin Masud Jumahi, with his chain. In it is Amir bin Saad, who is Bajali, for whom Muslim and the compilers of the Sunan works other than Ibn Majah narrated, except that no one deemed him reliable but Ibn Hibban, and for that reason Hafidh placed him at the rank of "acceptable." I say, and that is indeed the case, for Abu Salama corroborated him in the preceding chain.