Parshas Ki Setzei
“He shall live with you in your midst in the place that he shall choose, you must not afflict him!” (Devarim 23:17)
It is a negative commandment that one may not inflict pain on a slave who flees to us from outside Eretz Yisrael and about this the verse says “He shall live with you in your midst in the place that he shall choose, you must not afflict him!”. This refers to inflicting pain with words (meaning that we must not make him embarrassed or abuse him in any way with words) and all the more so we should not inflict pain by physically hurting him.
Amongst the roots of this commandment are that even though it is forbidden to inflict pain on any member of Klal Yisrael (and this emancipated slave is now a fully-fledged member of the nation), the Torah added here a specific prohibition, since the self-esteem of a slave is lower than that of other people, and also that other people might look at him and say that he is a slave and therefore does not mind. Because of all of the above, the Torah earned us explicitly not to cause him pain.
This prohibition applies to men and to women at all times.