Sayyiduna Abdullah bin Abi Awfa (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Allah Almighty is with the judge as long as he does not act unjustly. When he acts unjustly, Allah disowns him, and Satan attaches himself to him."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20451