Sahih al-Bukhari #2043
Retiring to a Mosque for Remembrance of Allah (I'tikaf) 33:18
Narrated Ibn `Umar:
that `Umar had vowed in the Pre-Islamic period to perform I`tikaf in Al-Masjid-al-Haram. (A subnarrator thinks that `Umar vowed to perform I`tikaf for one night.) Allah's Messenger (ﷺ) said to `Umar, "Fulfill your vow."