Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:48:24

And it is He who withheld their hands from you and your hands from them within ˹the area of˺ Makkah after He caused you to overcome them. And ever is Allah of what you do, Seeing.  

And it is He Who withheld their hands from you, and your hands from them, in the valley of Mecca, at alHudaybiyya, after He had made you victors over them: for eighty of them surrounded your camp in order to inflict losses upon you, but they were captured and taken to the Prophet (s), who pardoned them and set them free, and this resulted in the truce. And God is ever Seer of what you do (read ta‘malūna, or ya‘malūna, ‘they do’), that is to say, He is ever possessed of this attribute.
القرآن:٤٨:٢٤

وَهُوَ الَّذِي كَفَّ أَيْدِيَهُمْ عَنْكُمْ وَأَيْدِيَكُمْ عَنْهُمْ بِبَطْنِ مَكَّةَ مِنْ بَعْدِ أَنْ أَظْفَرَكُمْ عَلَيْهِمْ ۚ وَكَانَ اللَّهُ بِمَا تَعْمَلُونَ بَصِيرًا  

{وهو الذي كف أيديهم عنكم وأيديكم عنهم ببطن مكة} بالحديبية {من بعد أن أظفركم عليهم} فإن ثمانين منهم طافوا بعسكركم ليصيبوا منكم فأخذوا وأتي بهم إلى رسول الله ﷺ فعفا عنهم وخلى سبيلهم فكان ذلك سبب الصلح {وكان الله بما يعملون بصيرا} بالياء والتاء، أي لم يزل متصفا بذلك.