Sahih Bukhari Volume 9, Book 89, Hadith Number 282.
The people of Hijaz said, “A judge should not pass a judgment according to his knowledge, whether he was a witness at the time he was the judge or before that” And if a litigant gives a confession in favor of his opponent in the court, in the opinion of some scholars, the judge should not pass a judgment against him till the latter calls two witnesses to witness his confession. And some people of Iraq said, “A judge can pass a judgement according to what he hears or witnesses (the litigant’s confession) in the court itself, but if the confession takes place outside the court, he should not pass the judgment unless two witnesses witness the confession.” Some of them said, “A judge can pass a judgement depending on his knowledge of the case as he is trust-worthy, and that a witness is Required just to reveal the truth. The judge’s knowledge is more than the witness.” Some said, “A judge can judge according to his knowledge only in cases involving property, but in other cases he cannot.” Al-Qasim said, “A judge ought not to pass a judgement depending on his knowledge if other people do not know what he knows, although his knowledge is more than the witness of somebody else because he might expose himself to suspicion by the Muslims and cause the Muslims to have unreasonable doubt.”