Sunan Abi Dawud, Book 22, Hadith 84 (Abu Dawud 3326)

Narrated Ibn 'Umar:

That 'Umar said: Messenger of Allah, I took a vow in pre-Islamic times that I would stay in the sacred mosque (Masjid Haram) as a devotion (i'tikaf). The Prophet (ﷺ) said: Fulfill your vow.