The Prophet ﷺ used to observe itikaf during the last ten days of Ramadan until Allah took him.
حدثنا محمود بن غيلان حدثنا عبد الرزاق أخبرنا معمر عن الزهري عن سعيد بن المسيب عن أبي هريرة وعروة
أن النبي كان يعتكف العشر الأواخر من رمضان حتى قبضه الله
[Sahih]. Ahmad narrated it: 2/281, from Abdul-Razzaq, and Bukhari, no. 2026, and Muslim, no. 1172, from the hadith of Zuhri, with slight variation.There are also narrations on this topic from Ubayy bin Kaab [Abu Dawud, no. 2463], Abu Layla [Ahmad: 4/348], Abu Saeed [Bukhari, no. 2018, and Muslim, no. 1167], Anas [coming up: 803], and Ibn Umar [Bukhari, no. 2025, and Muslim, no. 1171].