[Machine] The Battle of Hudaibiya took place in the sixth year after the Prophet's migration to Medina, in the month of Dhu al-Qa'da. The Treaty of Hudaibiya took place in the month of Dhu al-Qa'da in the seventh year. The conquest of Mecca took place in the month of Ramadan in the eighth year. Then, the Prophet ﷺ went out from there to Hunayn and Taif. When he returned in the month of Shawwal, he performed Umrah from Ji'ranah. Then, Attab bin Asid performed Hajj and the Messenger of Allah ﷺ used his Hajj as a model for the people. Abu Bakr performed Hajj in the ninth year, following the example of the Prophet ﷺ. Then, the Prophet ﷺ performed Hajj in the tenth year after his migration to Medina, which is known as the Farewell Pilgrimage. This indicates that the order of conquest, the use of Attab bin Asid's Hajj, followed by Abu Bakr's in the ninth year, and then the Prophet's in the tenth year, is as mentioned by Imam Shafi'i, may Allah have mercy on him. This is well-known among the people of military expeditions and is mentioned in the connected narrations separately.
كَانَتِ الْحُدَيْبِيَةُ سَنَةَ سِتٍّ بَعْدَ مَقْدِمِ النَّبِيِّ ﷺ الْمَدِينَةَ فِي ذِي الْقَعْدَةِ وَكَانَتِ الْقَضِيَّةُ فِي ذِي الْقَعْدَةِ سَنَةَ سَبْعٍ وَكَانَ الْفَتْحُ فِي رَمَضَانَ سَنَةَ ثَمَانٍ ثُمَّ خَرَجَ النَّبِيُّ ﷺ مِنْ فَوْرِهِ إِلَى حُنَيْنٍ وَالطَّائِفِ فَلَمَّا رَجَعَ فِي شَوَّالٍ اعْتَمَرَ مِنَ الْجِعْرَانَةِ ثُمَّ حَجَّ عَتَّابُ بْنُ أَسِيدٍ فَأَقَامَ لِلنَّاسِ الْحَجَّ اسْتَعْمَلَهُ رَسُولُ اللهِ ﷺ عَلَى الْحَجِّ ثُمَّ حَجَّ أَبُو بَكْرٍ سَنَةَ تِسْعٍ اسْتَعْمَلَهُ النَّبِيُّ ﷺ ثُمَّ حَجَّ النَّبِيُّ ﷺ سَنَةَ عَشْرٍ مِنْ مَقْدِمِهِ الْمَدِينَةَ وَهِيَ حَجَّةُ الْوَدَاعِ وَفِي هَذَا دَلَالَةٌ عَلَى أَنَّ أَمْرَ الْفَتْحِ وَاسْتِعْمَالَ عَتَّابِ بْنِ أَسِيدٍ ثُمَّ اسْتِعْمَالُ أَبِي بَكْرٍ فِي سَنَةِ تِسْعٍ ثُمَّ حَجُّهُ سَنَةَ عَشْرٍ مَا قَالَهُ الشَّافِعِيُّ رَحِمَهُ اللهُ وَهُوَ مَشْهُوَرٌ فِيمَا بَيْنَ أَهْلِ الْمَغَازِي مَذْكُورٌ فِي الْأَحَادِيثِ الْمَوْصُولَةِ مُفَرَّقًا