The Prophet ﷺ ransomed two Muslim men in exchange for one polytheist man from Banu Aqeel.
حدثنا إسماعيل أخبرنا أيوب عن أبي قلابة عن أبي المهلب
أن النبي ﷺ فدى رجلين من المسلمين برجل من المشركين من بني عقيل
Its isnad is sahih. It is found in Tirmidhi 4/135, no. 1568, in the chapters on military expeditions, on what has been said about killing captives. He said, hasan sahih. It is also found in Muslim, at greater length, 3/1262, no. 1641, in the chapter on oaths, there is no fulfillment of a vow to commit disobedience.