It is narrated from Sayyiduna Buraydah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Judges are of three kinds: two are in Hell and one is in Paradise. A judge who knowingly judged unjustly is in Hell; and a judge who judged without knowledge and caused people's rights to be lost is also in Hell; and a judge who judged according to the truth is in Paradise."
Hadith Referenceالمعجم الكبير للطبراني / باب الباء / 1143