Sayyiduna Ali (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "When two men bring a dispute to you, do not judge for the first until you hear what the other has to say; then you will see how to judge." He said: I continued judging in this way ever after.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20469