Sayyiduna Abu Sa'id (may Allah be pleased with him) said that a man of the tribe of Aslam named Ma'iz (may Allah be pleased with him) came to the Prophet (peace and blessings be upon him). He confessed to adultery, and he (peace and blessings be upon him) turned away from him. When he insisted on it again and again, he (peace and blessings be upon him) asked his people: "Is Ma'iz not insane?" They said: We have not seen any such thing in him. The Prophet (peace and blessings be upon him) ordered him to be stoned. We brought him to Baqi' al-Gharqad; we neither tied him up nor buried him in the ground, and we pelted him with stones, and he ran because of the pain. We caught up with him at al-Harrah and pelted him there, and he died. Then in the evening, at the time of Isha, the Prophet (peace and blessings be upon him) delivered a sermon and said: "Whenever we set out on a military expedition in the path of Allah, some man stays behind among our families, bleating like a he-goat (in lust). Indeed, no man who has done that will be brought to me but I will make him an example to others." He (peace and blessings be upon him) neither spoke ill of Ma'iz (may Allah be pleased with him) nor sought forgiveness for him.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحدود / 16997