Ruling on the slaves emancipated by a governmental decree

Q 4: What is your opinion (may Allah grant you and us success) concerning slaves whom the government emancipated against their master's will? Are they regarded emancipated or not?

A 4: If it is proven that the cause of enslavement is legal, it is not permissible for the ruler to emancipate them against their master's will. This emancipation is not legal unless the Muslim ruler perceives a public interest in it, then he can free them but should pay their value to the master. This is based on the Prophet's (peace be upon him) judgment on the people enslaved from the tribe of Hawazin. However, if the cause of enslavement is not legal, as shown in the answers of questions 1, 2, 3, and 5, the government should emancipate them, even if it is against the master's will. And no compensation should be given to him, even if he claims they are his own slaves. May Allah grant us success. May Allah's Peace and Blessings be upon Prophet Muhammad, his family, and Companions!