Anas ibn Mālik (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) said: “Support your brother whether he is an oppressor or oppressed.” A man said: "O Messenger of Allah, I should support him if he is oppressed, but how should I support him if he is an oppressor?" The Prophet (may Allah's peace and blessings be upon him) said: “Support him by preventing him from practicing oppression.”
شرح الحديث :
The Prophet (may Allah's peace and blessings be upon him) said that one should support his brother and never disappoint him, whether he was an oppressor or oppressed. A man, then, said that helping one’s oppressed brother is by defending him if oppressed, but in case he is the oppressor, how can I help him? The Prophet (may Allah's peace and blessings be upon him) replied that he should help him by preventing him from oppressing others, which in reality is a help to him.