It is narrated from Sayyiduna Imran bin Husayn (may Allah be pleased with him) that a man freed slaves at the time of his death, and he had no wealth other than them. The matter was brought to the Messenger of Allah (peace and blessings be upon him), and he (peace and blessings be upon him) cast lots among them, freed two of them and returned the rest to slavery.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 15394