I went on seven military expeditions with the Prophet ﷺ, and I went out on nine expeditions among the detachments he dispatched. Once Abu Bakr was our commander, and once Usama bin Zayd was our commander.
غزوت مع النبي ﷺ سبع غزوات، وخرجت فيما يبعث من البعوث تسع غزوات: مرة علينا أبو بكر، ومرة علينا أسامة بن زيد.
Bukhari narrated it in the Book of Military Expeditions (4270, 4273, 4272, 4271) and Muslim in the Book of Jihad and Expeditions (1815: 148), both through routes from Yazid bin Abu Ubayd, who said, "I heard Salama say," then he related it.In the last version of Bukhari (4273), the expeditions mentioned are Khaybar, Hudaybiya, the day of Janin, and the day of Qarad. The narrator, Yazid bin Abu Ubayd, said, "and I forgot the rest of them (baqiyatahum)." The correct wording is "baqiyataha." Ibn Hajar said, "As for the remaining expeditions that Yazid forgot, they are the Battle of the Conquest, the Battle of Taif, and the Battle of Tabuk." Fath al-Bari (7/518).A note. In Ibn Hajar's copy, the wording "nine expeditions" appears instead of "seven expeditions" in the narration (4272), but the correct wording is "seven," as found in the other copies of Sahih Bukhari. Umdat Qari (17/273).It was narrated from Qatada that he said, "The military expeditions and raiding parties of the Messenger of Allah numbered forty-three, twenty-four of which were detachments and nineteen were expeditions, and he personally went out in eight of them, Badr, Uhud, the Trench, Mustaliq, Qudayd, Khaybar, the Conquest of Makkah, and Hunayn."Musa bin Uqba said, on the authority of Zuhri, "These are the expeditions of the Messenger of Allah in which he fought. The Day of Badr was in Ramadan of year two, then he fought on the Day of Uhud in Shawwal of year three, then he fought on the Day of the Trench, which is the Day of the Confederates, and against Banu Qurayza, in Shawwal of year four, then he fought Banu Mustaliq and Banu Lihyan in Shaban of year five, then he fought on the Day of Khaybar in year six, then he fought on the Day of the Conquest in Ramadan of year eight, then he fought on the Day of Hunayn and besieged the people of Taif in Shawwal of year eight, then Abu Bakr performed the hajj in year nine, then the Messenger of Allah performed the Farewell Pilgrimage in year ten. He also went on twelve expeditions in which there was no fighting, and the first expedition he undertook was to Abwa." See Bidaya wa Nihaya (5/19–20).The scholars of military expeditions and biographical accounts differed over the number of the Prophet's expeditions and raiding parties. Ibn Saad mentioned in his Tabaqat (2/5–6), on the authority of Waqidi and others, and said, "Some of their accounts overlapped with others." They said, "The number of expeditions that the Messenger of Allah personally led was twenty-seven, and the raiding parties he dispatched numbered forty-seven, and the expeditions in which he actually fought were nine, Badr, Uhud, Mustaliq, the Trench, Qurayza, Khaybar, the Conquest of Makkah, Hunayn, and Taif. This is what we have found agreement upon."In some of their accounts, it is said that he fought against Banu Nadir, but Allah made that a special spoil granted to him alone, and he fought during the expedition to Wadi Qura on the way back from Khaybar, where some of his companions were killed, and he fought at Ghaba. End of quote.As for Burayda's account in the hadith mentioned earlier, that he fought in eight of them, this would be arrived at by excluding the Conquest of Makkah, since it was said to have been achieved through a peaceful surrender, as Shafii stated, and likewise by excluding Banu Nadir, since Allah made it a special spoil granted to him alone.