Anas reported, "The Prophet ﷺ took us out from Medina to Mecca, and he kept praying two rakahs at a time until we returned to Medina."I asked, "How long did he stay in Mecca?"He replied, "Ten days."
يخرجنا مع النبي ﷺ من المدينة إلى مكة، فكان يصلي ركعتين ركعتين حتى رجعنا إلى المدينة. قلت: كم أقام بمكة؟ قال: عشرا.
Bukhari related it in the chapter on shortening the prayer (1081), and Muslim in the chapter on the prayer of travelers (693), both from the hadith of Yahya bin Abu Ishaq, who said, I heard Anas say, then he mentioned it. In a version found in Muslim, he says, We set out from Madinah for the Hajj, then he mentioned the same thing.Anas is referring to the Prophet's ﷺ stay during the Farewell Hajj, the Farewell Hajj, because he entered Makkah on the day of the Hajj, which was a Sunday, and he spent the night at Muhassab on the eve of Wednesday. On that night Ayesha performed umrah, on the morning of the fourth of Dhul-Hijjah, from Tanim. Then performed the farewell circumambulation before dawn, before the morning prayer on Wednesday, and he departed on its morning, which was the fourteenth. This is what Munziri said. See Nasb Raya (2/184). The hadith of Ibn Abbas that follows is specific to the conquest of Makkah.