Abu Talha reported,

The Prophet of Allah ﷺ ordered, on the day of Badr, that twenty-four bodies of the chiefs of Quraysh be cast into one of the foul, filthy wells of Badr. It was his custom, whenever he prevailed over a people, to remain at their battleground for three nights. On the third day at Badr, he ordered his mount to be prepared, and his saddle was fastened on it. Then he set off walking, and his companions followed him, saying, "We think he is going only for some need of his."He stopped at the edge of the well and began calling them by their names and the names of their fathers, "So-and-so, son of so-and-so, and so-and-so, son of so-and-so, would it have pleased you had you obeyed Allah and His Messenger? For we have indeed found what our Lord promised us to be true. Have you found what your Lord promised you to be true?"Umar said, "Messenger of Allah, how can you speak to bodies that have no souls in them?"The Messenger of Allah ﷺ replied, "By the One in whose hand is the soul of Muhammad, you do not hear what I say better than they do."

Azami 3828

Sahih

عن أبي طلحة

أن نبي الله ﷺ أمر يوم بدر بأربعة وعشرين رجلا من صناديد قريش فقذفوا في طوي من أطواء بدر خبيث محبث، وكان إذا ظهر على قوم أقام بالعرصة ثلاث ليال، فلما كان ببدر اليوم الثالث أمر براحلته فشد عليها رحلها، ثم مشى، واتبعه أصحابه وقالوا: ما نرى ينطلق إلا لبعض حاجته، حتى قام على شفة الركي، فجعل يناديهم بأسمائهم وأسماء آبائهم: يا فلان بن فلان، ويا فلان بن فلان، أيسركم أنكم أطعتم الله ورسوله؟ فإنا قد وجدنا ما وعدنا ربنا حقا، فهل وجدتم ما وعد ربكم حقا. قال: فقال عمر: يا رسول الله! ما تكلم من أجساد لا أرواح لها، فقال رسول الله ﷺ: والذي نفس محمد بيده ما أنتم بأسمع لما أقول منهم.

الأعظمي 3828صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Conditions of the deceased in the grave
Section
Hearing of the dead
Numbering
Jami al-Kamil 3828 (2nd edition)
Azami 3828