It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "When a mukatab (a slave who has contracted to buy his freedom) dies and leaves an inheritance, or commits a crime for which a prescribed punishment (hadd) becomes due, he inherits in proportion to the share of him that has been freed, and the prescribed punishment is carried out on him in proportion to the share of him that has been freed."
Related hadith on this topic