Sunan Ibn Majah, Book 13, Hadith 5 (Ibn Majah 2312)

It was narrated from 'Abdullah bin Abu Awfa that the Messenger of Allah (ﷺ) said:

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