Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:20177Abū ʿAbdullāh al-Ḥāfiẓ And ʾAbū Bakr Aḥmad b. al-Ḥasan al-Qāḍī > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > Muḥammad b. al-Jahm > Yazīd b. Hārūn > Ḥumayd al-Ṭawīl > Anas > Rasūl

[Machine] The Messenger of Allah, ﷺ , said, "Support your brother, whether he is an oppressor or oppressed." They said, "O Messenger of Allah, we understand how to support him if he is oppressed, but how do we support him if he is an oppressor?" He said, "By preventing him from committing oppression."  

البيهقي:٢٠١٧٧أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ وَأَبُو بَكْرٍ أَحْمَدُ بْنُ الْحَسَنِ الْقَاضِي قَالَا ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ ثنا مُحَمَّدُ بْنُ الْجَهْمِ ثنا يَزِيدُ بْنُ هَارُونَ عَنْ حُمَيْدٍ الطَّوِيلِ عَنْ أَنَسٍ ؓ

أَنَّ رَسُولَ اللهِ ﷺ قَالَ انْصُرْ أَخَاكَ ظَالِمًا أَوْ مَظْلُومًا قَالُوا يَا رَسُولَ اللهِ هَذَا نَنْصُرُهُ مَظْلُومًا فَكَيْفَ نَنْصُرُهُ ظَالِمًا؟ قَالَ تَمْنَعُهُ مِنَ الظُّلْمِ  

أَخْرَجَهُ الْبُخَارِيُّ فِي الصَّحِيحِ مِنْ وَجْهَيْنِ آخَرَيْنِ عَنْ حُمَيْدٍ وُرُوِّينَا عَنِ الْبَرَاءِ بْنِ عَازِبٍ ؓ قَالَ أَمَرَنَا رَسُولُ اللهِ ﷺ بِسَبْعٍ فَذَكَّرَهُنَّ وَفِيهِنَّ نَصْرِ الْمَظْلُومِ

See similar narrations below:

Collected by Aḥmad
ahmad:13079Yazīd > Ḥumayd > Anas

[Machine] The Messenger of Allah ﷺ said, "Help your brother, whether he is the oppressor or the oppressed." It was asked, "O Messenger of Allah, we understand how to help him when he is oppressed, but how do we help him when he is the oppressor?" He said, "By preventing him from oppressing."  

أحمد:١٣٠٧٩حَدَّثَنَا يَزِيدُ أَخْبَرَنَا حُمَيْدٌ عَنْ أَنَسٍ

أَنَّ رَسُولَ اللهِ ﷺ قَالَ انْصُرْ أَخَاكَ ظَالِمًا أَوْ مَظْلُومًا قِيلَ يَا رَسُولَ اللهِ هَذَا نَنْصُرُهُ مَظْلُومًا فَكَيْفَ نَنْصُرُهُ ظَالِمًا؟ قَالَ تَمْنَعُهُ مِنَ الظُّلْمِ