Anas bin Malik reported,

The Prophet ﷺ used to perform itikaf during the last ten days of Ramadan. One year he did not perform it, so the following year he performed itikaf for twenty days.

Tirmidhi 803

Sahih

حدثنا محمد بن بشار حدثنا ابن أبي عدي قال أنبأنا حميد الطويل

عن أنس بن مالك قال

كان النبي ﷺ يعتكف في العشر الأواخر من رمضان فلم يعتكف عاما فلما كان في العام المقبل اعتكف عشرين

الترمذي 803صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Fasting
Chapter
Itikaf if one leaves it
Numbering
Darussalam 803
Tirmidhi 803