Hadithcore
Riyad as-Salihin, 1270

Abu Hurairah (May Allah be pleased with him) reported:

The Prophet (ﷺ) used to observe I'tikaf every year (during Ramadan) for ten days; in the year in which he passed away, he observed I'tikaf for twenty days. <b>[Al-Bukhari]</b>.

وعن أبي هريرة رضي الله عنه قال‏:‏ كان النبي صلى الله عليه وسلم يعتكف في كل رمضان عشرة أيام، فلما كان العام الذي قبض فيه اعتكف عشرين يومًا ‏(‏‏(‏رواه البخاري‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Book 9, Hadith 3
Sharh · explanationclick to expand
<b>Guidance from the Hadiths:</b><br> 1) It is Sunnah to observe I‘tikāf in Ramadan and be devoted to worship.<br> 2) We are encouraged to seek out the night of Qadr during the last ten nights, at the time of I‘tikāf, given the special merit it has. A fortunate believer would seize virtuous times for performing acts of worship.<br> 3) A main purpose behind I‘tikāf is to devote one’s heart and body for worship, away from worldly preoccupations that distract him from worshiping his Lord.<br> Note:<br> The phrases some people say and hang on walls in the mosque, such as “I intend to observe I‘tikāf in this mosque as long as I remain in it”, are not prescribed by the Shariah, neither by the Prophet’s actions nor his statements. He did not instruct us saying: When you enter a mosque, harbor the intention for I‘tikāf at any time. Rather, we may observe I‘tikāf for a day or a night, and more, and preferably along with fasting. This general intention, however, is not part of the prescribed guidance.
Related hadiths7
Compare isnād across 7 related chains →