Sahih Bukhari | Volume 3 | Hadith Number 259

Narrated by Ibn 'Umar
That 'Umar had vowed in the Pre-Islamic 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, "Fulfil your vow."