The Prophet ﷺ sent a cavalry unit toward Najd, and they returned with a man from the tribe of Banu Hanifa called Thumama bin Uthal. They tied him to one of the pillars of the mosque.The Prophet ﷺ came out to him and said, "Release Thumama."He went to a grove of palm trees near the mosque, performed a full bath, then entered the mosque and declared, "I bear witness that there is no god but Allah, and that Muhammad is the Messenger of Allah."
بعث النبي ﷺ خيلا قبل نجد، فجاءت برجل من بني حنيفة يقال له: ثمامة بن أثال، فربطوه بسارية من سواري المسجد، فخرج إليه النبي ﷺ فقال: أطلقوا ثمامة. فانطلق إلى نخل قريب من المسجد فاغتسل، ثم دخل المسجد فقال: أشهد أن لا إله إلا الله، وأن محمدا رسول الله.
Bukhari (462) narrated it in abbreviated form like this, in the Book of Prayer, chapter on bathing when someone becomes Muslim, and tying up the captive in the masjid. He also narrated it at length in the Book of Campaigns (4372), and Muslim narrated it in the Book of jihad (1764), both of them through Layth bin Saad, from Saeed Maqburi, who heard Abu Hurairah, and he related it.It will come again at length in the Book of jihad. In some of the narrations it states that he became Muslim, so the Prophetﷺ sent him to the garden of the Banu Talha, and instructed him to perform ghusl, so he performed ghusl. Ibn Khuzayma narrated this (1/125) through Abdul-Razzaq, who said, Abdullah and Ubaydullah, the two sons of Umar, narrated to us, from Saeed Maqburi, from Abu Hurairah.Abdullah is daif, but his brother Ubaydullah corroborated him, and he is trustworthy. So either we give preference to the narration of the two Shaykhs (Bukhari and Muslim), or we reconcile between the two narrations, as Bayhaqi did (1/171), saying, it is possible that he became Muslim in the presence of the Prophetﷺ, then performed ghusl and entered the masjid, thereby openly declaring the testimony of faith. This contains an indication that the ghusl came after his becoming Muslim, as in the narration of Ibn Khuzayma.For more, see Minna Kubra (1/196).