ʿUmar bin Al-Khattab said, "O Messenger of Allah ﷺ! I vowed in the Pre-Islamic period to perform Iʿtikaf in Al-Masjid-al-Haram for one night." The Prophet ﷺ said, "Fulfill your vow." So, he performed Iʿtikaf for one night.
أَنَّهُ قَالَ يَا رَسُولَ اللَّهِ إِنِّي نَذَرْتُ فِي الْجَاهِلِيَّةِ أَنْ أَعْتَكِفَ لَيْلَةً فِي الْمَسْجِدِ الْحَرَامِ فَقَالَ لَهُ النَّبِيُّ ﷺ أَوْفِ نَذْرَكَ فَاعْتَكَفَ لَيْلَةً