Hadith
حَدَّثَنَا إِسْحَاقُ بْنُ مُوسَى الْخَطْمِيُّ، حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنْ أَيُّوبَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنْ عُمَرَ، أَنَّهُ كَانَ عَلَيْهِ نَذْرُ لَيْلَةٍ فِي الْجَاهِلِيَّةِ يَعْتَكِفُهَا فَسَأَلَ النَّبِيَّ ـ صلى الله عليه وسلم ـ فَأَمَرَهُ أَنْ يَعْتَكِفَ .
It was narrated from ‘Umar that he had vowed during the days of Ignorance to spend one night in I’tikaf. He asked the Prophet (ﷺ) about it, so he commanded him to spend it in I’tikaf
Sahih · Al-Albani
Sunan Ibn Majah 1772 ·Book 7, Hadith 135·Also available on sunnah.com·