Ibn Abi Awfa (may Allah be pleased with him) states that the Messenger of Allah (peace and blessings be upon him) said: "Allah is with the judge as long as he does not commit injustice. When he commits injustice, Allah disowns him and Satan clings to him."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20167