When we returned from (the battle of) Hunain, `Umar asked the Prophet (ﷺ) about a vow which he had made during the Pre-lslamic period of Ignorance that he would perform I`tikaf. The Prophet (ﷺ) ordered him to fulfill his vow.
Sahih al-Bukhari Book 64, Hadith 350