(17) باب الاِعْتِكَافِ فِي الْعَشْرِ الأَوْسَطِ مِنْ رَمَضَانَ
Narrated Abu Huraira:
The Prophet (ﷺ) used to perform I`tikaf every year in the month of Ramadan for ten days, and when it was the year of his death, he stayed in I`tikaf for twenty days.
Reference: Sahih al-Bukhari 2044
In-book reference: Book 33, Hadith 19
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 3, Book 33, Hadith 260