The Messenger of Allah ﷺ set out for Badr, and a man from the polytheists followed him and caught up with him at al-Jamra. He said, "I wanted to follow you and share in the spoils with you."The Prophet ﷺ asked, "Do you believe in Allah and His Messenger?"The man replied, "No."The Prophet said, "Then go back, for I will never seek the help of a polytheist."Then the man caught up with him again at the tree. The companions of the Messenger of Allah ﷺ were pleased to see him, for he was a man of strength and endurance. He said, "I have come to follow you and share in the spoils with you."The Prophet asked, "Do you believe in Allah and His Messenger?"The man replied, "No."The Prophet said, "Then go back, for I will never seek the help of a polytheist."Then the man caught up with him again when he had come out onto al-Bayda. The Prophet said the same to him, "Do you believe in Allah and His Messenger?"The man replied, "Yes."So the Prophet took him along.
حدثنا عبد الرحمن حدثنا مالك عن فضيل بن أبي عبد الله عن عبد الله بن نيار عن عروة
أن رسول الله ﷺ خرج إلى بدر فتبعه رجل من المشركين فلحقه عند الجمرة فقال إني أردت أن أتبعك وأصيب معك قال تؤمن بالله عز وجل ورسوله قال لا قال ارجع فلن نستعين بمشرك قال ثم لحقه عند الشجرة ففرح بذاك أصحاب رسول الله ﷺ وكان له قوة وجلد فقال جئت لأتبعك وأصيب معك قال تؤمن بالله ورسوله قال لا قال ارجع فلن أستعين بمشرك قال ثم لحقه حين ظهر على البيداء فقال له مثل ذلك قال تؤمن بالله ورسوله قال نعم قال فخرج به
Its isnad is sahih. Fudayl is Ibn Abu Abdullah, and Abd bin Niyar are both trustworthy, their hadith is found in Muslim, and the hadith has already appeared at 24267.