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."
أن نبي الله ﷺ أمر يوم بدر بأربعة وعشرين رجلا من صناديد قريش، فقذفوا في طوى من أطواء بدر خبيث مخبث. وكان إذا ظهر على قوم أقام بالعرصة ثلاث ليال. فلما كان ببدر اليوم الثالث أمر براحلته فشد عليها رحلها، ثم مشى واتبعه أصحابه وقالوا: ما نرى ينطلق إلا لبعض حاجته حتى قام على شفة الركي فجعل يناديهم بأسمائهم وأسماء آبائهم: يا فلان ابن فلان و يا فلان بن فلان، أيسركم أنكم أطعتم الله ورسوله؟ فإنا قد وجدنا ما وعدنا ربنا حقا، فهل وجدتم ما وعد ربكم حقا؟ قال: فقال عمر: يا رسول الله ما تكلم من أجساد لا أرواح لها، فقال رسول الله ﷺ: والذي نفس محمد بيده، ما أنتم بأسمع لما أقول منهم. قال قتادة: أحياهم الله حتى أسمعهم قوله توبيخا وتصغيرا ونقيمة وحسرة وندما.
Bukhari related it in Maghazi (3976) and Muslim in Paradise and the Description of Its Bliss and Its People (78:2875), both through the route of Saeed bin Abu Aruba, from Qatada, from Anas bin Malik, from Abu Talha (who is Zayd bin Sahl Ansari), who said, then he mentioned the account. The wording given here follows Bukhari, and Muslim's version is abridged. His statement, "at the lip of the raki," means the edge of the well. Raki, with fatha on the ra, kasra on the kaf, and a doubled final letter, refers to a well before it has been lined with stones. His statement, "in a tawiy among the tawiys of Badr," a tawiy is a well that has been lined and built up with stones so that it is made firm and does not collapse. The two narrations can be reconciled by understanding that it had originally been lined but had fallen into disrepair, so it came to resemble a raki. See Fath al-Bari (7/302).His statement, "he remained at the arsah for three nights," the arsah is an open space or a wide area. The number of polytheists killed was seventy, so perhaps the rest were buried in other places.