Imam al-Shafi'i (may Allah have mercy on him) said: The indication of the Sunnah in the hadith of Sayyiduna Imran bin Husayn (may Allah be pleased with him) is clear that the Messenger of Allah (peace and blessings be upon him) treated their emancipation during (the master's final) illness as a bequest. The one who freed them was a man of the Arabs, and an Arab only owns non-Arabs with whom he has no kinship; so the Prophet (peace and blessings be upon him) permitted the bequest for them.
This hadith is established through Abu al-Muhallab and Muhammad bin Sirin from Imran.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوصايا / 12549