Releasing a prisoner who is hoped to embrace Islam
is permissible, as in the hadith of Thumamah (may Allah be pleased with him), in which the Messenger of Allah ﷺ said:
أطلقوا ثمامة
“Release Thumamah.”
So he went to a palm grove near the mosque, performed ghusl, then entered the mosque and said:
أشهد أن لا إله إلا الله وأشهد أن محمدا رسول الله
[Bukhari: 4372, Kitab al-Maghazi: Bab Wafd Bani Hanifah wa Hadith Thumamah ibn Uthal, Muslim: 1764, Abu Dawud: 2679, Nasa’i: 109/1, Ahmad: 452/2]