Sahih al-Bukhari #2032
Retiring to a Mosque for Remembrance of Allah (I'tikaf) 33:7
Narrated Ibn `Umar:
`Umar asked the Prophet (ﷺ) "I vowed in the Pre-Islamic period of ignorance to stay in I`tikaf for one night in Al-Masjid al-Haram." The Prophet (ﷺ) said to him, "Fulfill your vow."