Mishkat al-Masabih
Mishkat al-Masabih 3735
وَعَنْ بُرَيْدَةَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: " الْقُضَاةُ ثَلَاثَةٌ: وَاحِدٌ فِي الْجَنَّةِ وَاثْنَانِ فِي النَّارِ فَأَمَّا الَّذِي فِي الْجَنَّةِ فَرَجُلٌ عَرَفَ الْحَقَّ فَقَضَى بِهِ وَرَجُلٌ عَرَفَ الْحَقَّ فَجَارَ فِي الْحُكْمِ فَهُوَ فِي النَّارِ وَرَجُلٌ قَضَى لِلنَّاسِ عَلَى جَهْلٍ فَهُوَ فِي النَّارِ ". رَوَاهُ أَبُو دَاوُدَ وَابْنُ مَاجَهْ
Burayda reported that the Messenger of God said: Judges are of three kinds: one is in Paradise and two are in Hell. The one in Paradise is a man who recognizes the truth and judges by it. A man who recognizes the truth but acts unjustly in his judgment is in Hell. A man who judges for people in ignorance is in Hell. Abu Dawud and Ibn Majah transmitted it.