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.
أَنَّهُ قَالَ يَا رَسُولَ اللَّهِ إِنِّي نَذَرْتُ فِي الْجَاهِلِيَّةِ أَنْ أَعْتَكِفَ فِي الْمَسْجِدِ الْحَرَامِ لَيْلَةً فَقَالَ لَهُ النَّبِيُّ ﷺ أَوْفِ بِنَذْرِكَ