It is narrated from Sayyiduna Ali bin Abi Talib (may Allah be pleased with him) that on the day of al-Hudaybiyah, before the truce, some slaves came out and presented themselves to the Messenger of Allah (peace and blessings be upon him). Their masters wrote to him (peace and blessings be upon him) and said: "O Muhammad, by Allah, these people have not come to you out of desire for your religion; they have only come fleeing from slavery." At this some people said: "O Messenger of Allah, send them back." The Messenger of Allah (peace and blessings be upon him) became angry and said: "O people of Quraysh, I do not think you will desist until Allah sends against you someone who will strike your necks for this (religion)." And he (peace and blessings be upon him) refused to return them and said: "They are the freed slaves of Allah, the Mighty and Majestic."
Imam Abu Dawud (may Allah have mercy on him) narrated it like this in his "Sunan".
And Imam al-Tirmidhi (may Allah have mercy on him) narrated something similar from Sufyan bin Waki', from his father, from Sharik, and he said: "This hadith is hasan sahih gharib."