It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that on the day of the Battle of Ta’if, when the people of Ta’if were besieged, two of their slaves came out and joined the Prophet (peace and blessings be upon him). The Prophet (peace and blessings be upon him) set them free, one of whom was Sayyiduna Abu Bakrah (may Allah be pleased with him). And it was the practice of the Prophet (peace and blessings be upon him) to set free all the slaves of the polytheists who came to him.