Abu Talha reported,

The Prophet of Allah ﷺ gave orders on the day of Badr concerning twenty-four men from among the chiefs of Quraysh, and they were thrown into one of the wells of Badr, foul and made to be foul. Whenever he prevailed over a people, he would remain at the battlefield for three nights. On the third day at Badr, he ordered that his mount be prepared, and its saddle was fastened upon it. Then he set out 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? We have found what our Lord promised us to be true, so have you found what your Lord promised you to be true?"Umar said, "Messenger of Allah, why do 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 any better than they do."Qatada said, "Allah brought them back to life so that they could hear his words, as a rebuke, a humiliation, a retribution, a cause of regret, and a source of remorse."

Azami 8774

Sahih

عن أبي طلحة

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

الأعظمي 8774صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Expedition of Badr
Section
Messenger of Allah ﷺ calling out the names of those killed at Badr after they were thrown into the well
Numbering
Jami al-Kamil 8774 (2nd edition)
Azami 8774