Sayyiduna 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 leaves him to himself."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20168