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.
suyuti:5063a

“Allah is with the judge so long as he is not unjust, but if he rules unjustly, He entrusts him to himself.” (Using translation from Ibn Mājah 2312)   

السيوطي:٥٠٦٣a

"إِنَّ الله مع القاضي ما لم يَجُرْ عمدًا فإِذا جَارَ وَكَلَه إِلى نفسه".  

[هـ] ابن ماجة [حب] ابن حبّان [طب] الطبرانى في الكبير [ق] البيهقى في السنن عن عبد الله بن أَبي أَوفى

See similar narrations below:

Collected by Ibn Mājah, Suyūṭī
ibnmajah:2312Aḥmad b. Sinān > Muḥammad b. Bilāl > ʿImrān al-Qaṭṭān > Ḥusayn / Ibn ʿImrān > Abū Isḥāq al-Shaybānī > ʿAbdullāh b. Abū Awfá

“Allah is with the judge so long as he is not unjust, but if he rules unjustly, He entrusts him to himself.”  

ابن ماجة:٢٣١٢حَدَّثَنَا أَحْمَدُ بْنُ سِنَانٍ حَدَّثَنَا مُحَمَّدُ بْنُ بِلاَلٍ عَنْ عِمْرَانَ الْقَطَّانِ عَنْ حُسَيْنٍ يَعْنِي ابْنَ عِمْرَانَ عَنْ أَبِي إِسْحَاقَ الشَّيْبَانِيِّ عَنْ عَبْدِ اللَّهِ بْنِ أَبِي أَوْفَى قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ إِنَّ اللَّهَ مَعَ الْقَاضِي مَا لَمْ يَجُرْ فَإِذَا جَارَ وَكَلَهُ إِلَى نَفْسِهِ  

suyuti:5064a
Request/Fix translation

  

السيوطي:٥٠٦٤a

"إِن الله مع القاضي ما لم يَجُرْ فإِذا جارَ تبرَّأ الله منه، وأَلزَمه الشيطانَ".  

[ك] الحاكم في المستدرك [ق] البيهقى في السنن عن ابن أَبي أَوْفى