The Messenger of Allah ﷺ sent out a cavalry detachment toward Najd, and they returned with a man from Banu Hanifa named Thumama bin Uthal, the chief of the people of Yamama. They tied him to one of the pillars of the mosque. Abridged.
أخبرنا قتيبة حدثنا الليث عن سعيد بن أبي سعيد أنه سمع
بعث رسول الله ﷺ خيلا قبل نجد فجاءت برجل من بني حنيفة يقال له ثمامة بن أثال سيد أهل اليمامة فربط بسارية من سواري المسجد مختصر
Bukhari narrated it in the Book of Prayer, chapter on a polytheist entering the masjid, hadith no. 469, and Muslim in the Book of Jihad and Expeditions, chapter on binding and detaining a captive and the permissibility of releasing him as a favor, hadith no. 1764, from Qutayba, with this wording. It is also found in Kubra, hadith no. 791.