Abdullah bin Abbas reported,

The Messenger of Allah ﷺ accepted ransom for the captives of Badr. The ransom for each man among them was four thousand. Uqba bin Abu Muayt was killed before being ransomed. Ali bin Abu Talib stood up and executed him.Uqba asked, "Who will care for my young children, Messenger of Allah?"He replied, "The Fire."

Azami 8770

Sahih

عن ابن عباس قال

فادي رسول الله ﷺ أسارى بدر، وكان فداء كل رجل منهم أربعة آلاف، وقتل عقبة بن أبي معيط قبل الفداء قام إليه علي بن أبي طالب فقتله صبرا، قال: من للصبية يا رسول الله؟ قال: النار.

الأعظمي 8770صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Expedition of Badr
Section
Killing of Uqba bin Abu Muit as a prisoner while on the way to Madinah
Numbering
Jami al-Kamil 8770 (2nd edition)
Azami 8770