Sahih al-Bukhari 2032
Sahih al-Bukhari · Book 33: Retiring to a Mosque for Remembrance of Allah (I'tikaf) · The I'tikaf at night.
Narrated Ibn `Umar:
حَدَّثَنَا مُسَدَّدٌ ، حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ ، عَنْ عُبَيْدِ اللَّهِ ، أَخْبَرَنِي نَافِعٌ ، عَنِ ابْنِ عُمَرَ ـ رضى الله عنهما ـ أَنَّ عُمَرَ ، سَأَلَ النَّبِيَّ صلى الله عليه وسلم قَالَ كُنْتُ نَذَرْتُ فِي الْجَاهِلِيَّةِ أَنْ أَعْتَكِفَ لَيْلَةً فِي الْمَسْجِدِ الْحَرَامِ، قَالَ " فَأَوْفِ بِنَذْرِكَ " .
`Umar asked the Prophet (ﷺ) "I vowed in the Pre-Islamic period of ignorance to stay in I`tikaf for one night in Al-Masjid al-Haram." The Prophet (ﷺ) said to him, "Fulfill your vow."