Narrated Abdullah bin Umar: 'Umar bin Al-Khattab said, "O Allah's Apostle! I vowed in the Pre-lslamic period to perform Itikaf in Al-Masjid-alHaram for one night." The Prophet said, "Fulfill your vow." So, he performed Itikaf for one night.
— Sahih Bukhari, Volume 3, Book 33: Retiring to a Mosque for Remembrance of Allah (I'tikaf), Hadith #258