Abu Saeed Khudri reported,

A man from Aslam named Maez bin Malik came to the Messenger of Allah ﷺ and said, "I have committed an indecency, so carry out the punishment on me."The Prophet ﷺ turned him away several times. Then he asked the man's people about him, and they said, "We know nothing wrong with him, except that he has done something and believes nothing will clear him of it but having the prescribed penalty carried out on him."So the man returned to the Prophet ﷺ, and he ordered us to stone him. We took him out to Baqi al-Gharqad. We neither tied him up nor dug a pit for him. We pelted him with bones, clods of dried earth, and shards of pottery. He broke into a run and we ran after him until he reached the open ground of the lava field, where he stood facing us. Then we pelted him with the boulders of the lava field, meaning the rocks, until he fell silent.Later that evening the Messenger of Allah ﷺ stood up to address the people and said, "Is it that every time we set out on an expedition in the way of Allah, one man stays behind among our families, bleating like a male goat? I swear that any man brought to me who has done such a thing, I will make an example of him."He neither prayed for forgiveness for him nor cursed him.Another version of the report says, The Prophet ﷺ stood up that evening, praised Allah and extolled Him, then said, "Now then, what is the matter with certain people that when we go out to fight, one of them stays behind, bleating like a male goat?" In this version he did not say "among our families."

Muslim 4429

Sahih

حدثني محمد بن حاتم حدثنا بهز حدثنا يزيد بن زريع حدثنا داود بهذا الإسناد مثل معناه وقال في الحديث فقام النبي ﷺ من العشي فحمد الله وأثنى عليه ثم قال أما بعد فما بال أقوام إذا غزونا يتخلف أحدهم عنا له نبيب كنبيب التيس ولم يقل في عيالنا

مسلم 4429صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Legal punishments
Chapter
One who confessed to committing zina
Numbering
Darussalam 4429
Muslim 4429