Book 015, Number 4072: Ibn 'Umar reported that Umar (b. Khattab) said: Messenger of Allah, I had taken a vow during the days of Ignorance (Jahiliyya) that I would observe I'tikaf for a night in the Sacred Mosque. He (the Holy Prophet) said: Fulfil your vow.
'Abdullah bin 'Umar reported that 'Umar bin Khattab asked the Messenger of Allah (ﷺ) as he was at ji'rana (a town near Makkah) on his way back from Ta'if: Messenger of Allah, I had taken a vow during the days of Ignorance that I would observe I'tikaf for one day in the Sacred Mosque. So what is your opinion? He said: Go and observe I'tikaf for a day. And Allah's Messenger (ﷺ) gave him a slave girl out of the one-fifth (of the spoils of war meant for the Holy Prophet). And when Allah's Messenger (ﷺ) set the war prisoners free, 'Umar bin Khattab heard their voice as they were saying: Allah's Messenger (ﷺ) has set us free. He (Hadrat 'Umar) said: What is this? They said: Allah's Messenger (ﷺ) has set free the prisoners of war (which had fallen to the lot of people). Thereupon he (Hadrat 'Umar) said:'Abdullah, go to that slave-girl and set her free.
ibn 'Umar reported: When Allah's Apostle (ﷺ) came back from the Battle of Hunain, Umar asked Allah's Messenger (ﷺ) about the vow he had taken during the days of Ignorance that he would observe I'tikaf for a day. The rest of the hadith is the same.
Nafi' reported: A mention of Allah's Messenger (ﷺ) observing 'Umrah from ja'rina was made before Ibn 'Umar. He said: He did not enter into the state of Ihram from that (place), and Umar had taken a vow of observing I'tikaf for a night during the days of Ignorance. The rest of the hadith is the same.