The imam, the scholar who acted on his knowledge, one of the eminent imams and of the most excellent judges of the community.
The Commander of the Faithful al-Mahdi appointed him to the judgeship in Baghdad, on the eastern side.
He transmitted from Muhammad ibn 'Abd al-Rahman ibn Abi Layla, Sulayman al-A'mash, and others.
Al-Khatib transmitted from Ishaq ibn Ibrahim that he said: The companions of Abu Hanifa, may God Most High be pleased with him, who discussed [questions] with him were: Abu Yusuf, Zufar, Dawud al-Ta'i, Asad ibn 'Amr, 'Afiya al-Awdi, al-Qasim ibn Ma'n, 'Ali ibn Mushir, and Mandal and Hibban, the two sons of 'Ali. They would go deep into a question, and if 'Afiya was not present, Abu Hanifa, may God Most High be pleased with him, would say: Do not take the question up [i.e. conclude it] until 'Afiya is present. When 'Afiya came, if he agreed with them, Abu Hanifa, may God Most High be pleased with him, would say: Record it. If he did not agree with them, Abu Hanifa would say: Do not record it.
Al-Mahdi had shared the judgeship between him and Muhammad ibn 'Abd Allah ibn 'Ulatha al-Kilabi; they both used to judge in the congregational mosque in al-Rusafa, this one at its near end and that one at its far end. 'Afiya was the more frequent of the two in visiting al-Mahdi.
Isma'il ibn Ishaq the judge related from his shaykhs, who said: 'Afiya the judge held the judgeship of one of the two sides of Baghdad for al-Mahdi, in place of Ibn 'Ulatha. 'Afiya was a learned ascetic. One day he went to al-Mahdi at the time of the noon prayer, when he was alone, and asked permission to enter; he admitted him, and behold, he had his document case with him. He asked to be released from the judgeship, and asked his permission to hand over the case to whomever he ordered. [Al-Mahdi] thought that one of the courtiers had belittled him or weakened his hand in judging, and spoke to him about that. He said: Nothing of this has happened. He said: Then what is the reason for your asking release? He said: Two wealthy, prominent litigants have been coming before me for two months, in a difficult, obscure case; each claims proof and witnesses, and puts forward arguments that require reflection and careful verification. So I kept putting off the case, hoping that they would reconcile, or that a way of deciding between them would occur to me. He said: Then one of them learned, from what was known about me, that I love sukkar dates, so at this time of ours — which is the very beginning of the date season — he set about collecting sukkar dates such as no one could collect at this time except the Commander of the Faithful; I have never seen better. He bribed my doorkeeper with a sum of dirhams to bring the tray in to me, not caring whether it was sent back. When it was brought in to me I disapproved of that, dismissed my doorkeeper and ordered the tray to be returned, and it was returned. When today came he came before me with his opponent, and the two were not equal in my heart nor in my eye. And this, O Commander of the Faithful, when I did not accept; so how would my state be had I accepted? I am not safe from a trick befalling me in my religion so that I perish, and people have become corrupt. So release me — may God release you — and excuse me. So he excused him.
It is transmitted from one of them that he said: I was with al-Rashid one day, and a complaint was brought to him about a judge he had appointed, called 'Afiya. It weighed heavily with him, and he ordered him to be brought, and he was brought. There was a large crowd in the assembly. The Commander of the Faithful began addressing him and confronting him with what had been reported against him, and the session went on long. Then the Commander of the Faithful sneezed, and those present who were near him said the blessing to him, except him; he did not say the blessing. Al-Rashid said to him: What is the matter with you, that you did not bless me as the people did? 'Afiya said to him: Because you, O Commander of the Faithful, did not praise God; therefore I did not bless you. Here is the Prophet, God bless him and grant him peace: two men sneezed in his presence, and he blessed one of them and did not bless the other. [The latter] said: O Messenger of God, why did you bless that one and not bless me? He said: «Because this one praised God, so we blessed him; and you did not praise Him, so I did not bless you.» Al-Rashid said to him: Return to your office; you who would not overlook a sneeze, would you overlook something else? He sent him away with a fine dismissal, and rebuked the people who had brought the complaint against him.
Ibn al-A'rabi said: Abu Dulama brought a suit against a man before 'Afiya, may God Most High have mercy on him, and said:
The misguided among men have disputed with me ... and I have disputed with them for a full year;
Yet God has not refuted any proof of mine ... nor has God made any rhyme of mine fail.
So whoever's injustice I have feared ... I do not fear you, O 'Afiya.
'Afiya said to him: I shall complain of you to the Commander of the Faithful. He said: Why would you complain of me? He said: Because you have satirised me. He said: By God, if you complain of me to him he will dismiss you. He said: And why? He said: Because you do not know satire from praise. May God Most High have mercy on him — how pure was his intention and how sound his inner self! May God benefit us by his blessings. Amen.