The Prophet ﷺ said: When a mukatab (a slave who has made an agreement to purchase his freedom) gifts blood-money or an inheritance, he can inherit in accordance with the extent to which he has been emancipated. Abu Dawud said: Wuhaib transmitted it from Ayyub, from 'Ikrimah, on the authority of 'Ali, from the Prophet ﷺ: and Hammad b. Zaid and Isma'il have transmitted it in a mursal form (i.e the link of the Companion being missing) from Ayyub, from 'Ikrimah, from the Prophet ﷺ. Isma'il b. 'Ulayyah has treated it as a statement of 'Ikrimah.
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِذَا أَصَابَ الْمُكَاتَبُ حَدًّا أَوْ وَرِثَ مِيرَاثًا يَرِثُ عَلَى قَدْرِ مَا عَتَقَ مِنْهُ