Sayyiduna Imran bin Husayn (may Allah be pleased with him) says that the Companions took a man of Banu Uqayl captive, tied him up and threw him on the stony ground. The Messenger of Allah (peace and blessings be upon him) passed by him, and we were with him. He (peace and blessings be upon him) was riding a donkey, with a cloth beneath him (peace and blessings be upon him). The man called out to him (peace and blessings be upon him): "O Muhammad! O Muhammad!" He (peace and blessings be upon him) came to him and asked: "What is the matter?" He said: "Why have I been seized? And why was the one that outstrips the pilgrims (the she-camel) seized?" He (peace and blessings be upon him) said: "You have been seized for the crime of your allies, Banu Thaqif, and Banu Thaqif had taken two Companions captive." He (peace and blessings be upon him) left him and moved on. He called out again: "O Muhammad! O Muhammad!" The Messenger of Allah (peace and blessings be upon him) felt pity for him and came back. He (peace and blessings be upon him) asked: "What is the matter?" He said: "I am a Muslim." He (peace and blessings be upon him) said: "Had you said this when you were free, you would have succeeded in every way." The narrator says: He (peace and blessings be upon him) left him and moved on, and he called out: "O Muhammad! O Muhammad!" He (peace and blessings be upon him) came back. He said: "I am hungry, feed me." The narrator says: I think he said: "I am thirsty, give me water." He (peace and blessings be upon him) said: "This is your need." The narrator says: The Messenger of Allah (peace and blessings be upon him) ransomed in exchange for him his two men whom Banu Thaqif had taken captive. He (peace and blessings be upon him) also took his she-camel.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18066