We were with the Messenger of Allah ﷺ at Hudaybiyah, beneath the tree that Allah Almighty mentioned in the Quran. The branches of that tree kept brushing against the back of the Messenger of Allah ﷺ. Ali bin Abu Talib and Suhayl bin Amr were before him.The Messenger of Allah ﷺ said to Ali, may Allah be pleased with him, "Write, In the name of Allah, the Most Gracious, the Most Merciful."Suhayl bin Amr grabbed his hand and said, "We do not know 'In the name of Allah, the Most Gracious, the Most Merciful.' Write in our agreement what we recognize."He said, "Write, In Your name, O Allah."So he wrote, "This is what Muhammad, the Messenger of Allah ﷺ, has agreed upon with the people of Makkah."Suhayl bin Amr again seized his hand and said, "We have wronged you if you truly are His Messenger. Write in our agreement what we recognize."He said, "Write, This is what Muhammad bin Abdullah bin Abdul-Muttalib has agreed upon, though I am the Messenger of Allah ﷺ."So he wrote it. While we were in this state, thirty young men suddenly came out against us bearing arms and rushed at us. The Messenger of Allah ﷺ supplicated against them, and Allah took away their sight. We advanced toward them and seized them.The Messenger of Allah ﷺ asked, "Have you come under anyone's covenant, or has anyone granted you safe conduct?"They said, "No."So he let them go free. Then Allah
revealed, "And it is He who withheld their hands from you and your hands from them within Makkah, after He had enabled you to overcome them. And Allah is ever Seeing of what you do" [Fath 48:24].Abu Abdul-Rahman said, Hammad bin Salama related this hadith from Thabit, from Anas, while Husayn bin Waqid related it from Abdullah bin Mughafal, and this latter version is, in my view, correct, if Allah wills.
قال حدثنا زيد بن الحباب قال حدثني حسين بن واقد قال حدثني ثابت البناني
كنا مع رسول الله ﷺ بالحديبية في أصل الشجرة التي قال الله تعالى في القرآن وكان يقع من أغصان تلك الشجرة على ظهر رسول الله ﷺ وعلي بن أبي طالب وسهيل بن عمرو بين يديه فقال رسول الله ﷺ لعلي رضي الله تعالى عنه اكتب بسم الله الرحمن الرحيم فأخذ سهيل بن عمرو بيده فقال ما نعرف بسم الله الرحمن الرحيم اكتب في قضيتنا ما نعرف قال اكتب باسمك اللهم فكتب هذا ما صالح عليه محمد رسول الله ﷺ أهل مكة فأمسك سهيل بن عمرو بيده وقال لقد ظلمناك إن كنت رسوله اكتب في قضيتنا ما نعرف فقال اكتب هذا ما صالح عليه محمد بن عبد الله بن عبد المطلب وأنا رسول الله ﷺ فكتب فبينا نحن كذلك إذ خرج علينا ثلاثون شابا عليهم السلاح فثاروا في وجوهنا فدعا عليهم رسول الله ﷺ فأخذ الله عز وجل بأبصارهم فقدمنا إليهم فأخذناهم فقال رسول الله ﷺ هل جئتم في عهد أحد أو هل جعل لكم أحد أمانا فقالوا لا فخلى سبيلهم فأنزل الله عز وجل {وهو الذي كف أيديهم عنكم وأيديكم عنهم ببطن مكة من بعد أن أظفركم عليهم وكان الله بما تعملون بصيرا} قال أبو عبد الرحمن قال حماد بن سلمة في هذا الحديث عن ثابت عن أنس وقال حسين بن واقد عن عبد الله بن مغفل وهذا الصواب عندي إن شاء الله
Its isnad is sahih. Husayn bin Waqid is Marwazi the judge, who is trustworthy despite having some errors, and his hadith is found in Muslim and the Sunan works. The hadith was narrated by the leading imams with a similar wording, and Haythami said in 6/145, "The narrators of Ahmad are the narrators of the Sahih."