He—may Allah Most High have mercy on him—was asked:
About some slaves who had stood surety for a man. They belonged to a vile Muslim living in Tatar lands. They are united in obeying Allah and His Messenger: they wish to perform Hajj, offer their prayers, pay zakat, and give charity. Their master, however, is dominated by disobedience and prevents them from obeying Allah and His Messenger. They could not bring themselves to disobey Allah and His Messenger. He is a highway robber, drinks wine, commits unlawful sexual intercourse, abandons prayer, and kills people whose lives Allah has made inviolable. They ask him to sell them, but he refuses; they ask him to free them, but he refuses. Whenever they mention any of this to him, he beats and imprisons them, leaving them to starve. So they agreed among themselves and fled to Egypt, seeking to obey Allah and His Messenger. Some of them have now performed Hajj. Is there any explicit text concerning their obedience to Allah and His Messenger, given that they have run away?
He replied:
If their circumstances are as they describe—that this man prevents them from doing what Allah and His Messenger have commanded and forces them to do what Allah and His Messenger have forbidden—then leaving his control was permissible; indeed, it was obligatory. They have done well in what they did, for someone who behaves in this way has no claim to inviolability. This would be so even if he were under Muslim authority; how much more so if he were under Tatar authority? It is obligatory to fight him, even if he is a Muslim.
These emigrants who fled to save themselves have done well in doing so. When a slave emigrates from territory at war with the Muslims, he becomes free, and no one has authority over him.