أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ يَزِيدَ، قَالَ حَدَّثَنَا سُفْيَانُ، عَنْ أَيُّوبَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ كَانَ عَلَى عُمَرَ نَذْرٌ فِي اعْتِكَافِ لَيْلَةٍ فِي الْمَسْجِدِ الْحَرَامِ فَسَأَلَ رَسُولَ اللَّهِ صلى الله عليه وسلم عَنْ ذَلِكَ فَأَمَرَهُ أَنْ يَعْتَكِفَ ‏.‏

It was narrated that Ibn 'Umar said: "Umar had made a vow to spend a night in 'Itikaf in Al-Masjid Al-Haram. He asked the Messenger of Allah about that, and he ordered him to perform the 'Itikaf." Translation Not Available

Book Ref: Sunan An Nisai Book 35 Hadith 3821
Web Ref:  Sunan An Nisai Vol 4 Book 35 Hadith 3852