There is no disagreement among the scholars regarding this, due to the saying of Allah the Almighty: {And those who commit unlawful sexual intercourse of your women – bring against them four [witnesses] from among you} (1). And the Almighty said: {And those who accuse chaste women and then do not produce four witnesses – lash them with eighty lashes} (2). And the Almighty said: {Why did they not bring four witnesses for it? And when they do not produce the witnesses, then it is they who are, in the sight of Allah, the liars} (3). Sa'd ibn Ubadah said to the Messenger of Allah (may Allah bless him and grant him peace): "What if I were to find a man with my wife, should I wait until I bring four witnesses?" The Prophet (may Allah bless him and grant him peace) replied: "Yes." Narrated by Malik in Al-Muwatta and Abu Dawud in his Sunan (4). The second condition is that they must all be men, and the testimony of women is not accepted regarding it under any circumstances. We know of no disagreement on this, except for something narrated from Ata' and Hammad that three men and two women are accepted. This is an anomalous (shudhudh) position upon which no reliance is placed, because the term "four" is a name for a number of males (5), and it dictates that four are sufficient. There is no disagreement that if the four include some women, they are not sufficient, and that the minimum that would suffice is five, but this contradicts the textual evidence (nass). Furthermore, there is a doubt (shubhah) in their testimony due to the possibility of error (dalal) on their part. Allah the Almighty said: {That if one of the two errs, the other can remind her} (6). And hadd punishments are warded off by doubts. The third condition is freedom; the testimony of slaves is not accepted regarding it. We know of no disagreement on this, except for a narration attributed to Ahmad that their testimony is accepted. This is the opinion of Abu Thawr, due to the generality of the texts regarding it, and because he is a just, male Muslim, so his testimony should be accepted like that of a free man. Our argument is that his testimony in other rights is disputed, so it constitutes a doubt that prevents the acceptance of his testimony in the hadd, because it is warded off by doubts.
(1) Surah An-Nisa, 15. (2) Surah An-Nur, 4. (3) Surah An-Nur, 13. (4) Reported by Malik, in: Chapter: Ruling on one who finds a man with his wife, from the Book of Judgments, and in: Chapter: What has been narrated regarding stoning, from the Book of Hudud, Al-Muwatta 2/737, 823. And Abu Dawud, in: Chapter: Regarding one who finds a man with his wife, may he kill him?, from the Book of Hudud, Sunan Abi Dawud 2/448. It was also reported by Muslim, in the Book of Li'an (Imprecation), Sahih Muslim 2/1135, 1136. (5) In B and M: "al-madhkurin" (the aforementioned). (6) Surah Al-Baqarah, 282.