Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: When the Prophet (peace and blessings be upon him) halted at Ta'if, he ordered a caller to announce: "Any slave who comes out is free." So two slaves came out to him (peace and blessings be upon him), and he (peace and blessings be upon him) set them free.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12066