It is narrated from Sayyiduna Ali (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said concerning the captives of Badr: "If you wish, kill them; and if you wish, ransom them and benefit from the ransom, and from among you a number equal to theirs will be martyred." And the last of the seventy martyrs was Thabit bin Qays (may Allah be pleased with him), who was martyred at al-Yamamah.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قسم الفيء والغنيمة / 12845