Narrated Ibn 'Umar: that 'Umar had vowed in the Pre-lslamic period to perform Itikaf in Al-Masjid-al-Haram. (A sub-narrator thinks that 'Umar vowed to perform Itikaf for one night.) Allah's Apostle said to 'Umar, "Fulfill your vow."
— Sahih Bukhari, Volume 3, Book 33: Retiring to a Mosque for Remembrance of Allah (I'tikaf), Hadith #259