Sahih Bukhari Volume 003, Book 033, Hadith Number 248.

Narated By Ibn 'Umar : Umar asked the Prophet "I vowed in the Pre-lslamic period of ignorance to stay in Itikaf for one night in Al-Masjid al-Haram." The Prophet said to him, "Fulfill your vow."