Sahih al-Bukhari Book 33, Hadith 7
`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."
The Prophet (ﷺ) used to embrace me during my menses. He also used to put his head out of the mosque while he was in I`tikaf, and I would wash it during my menses.
Aisha said, "the Prophet (ﷺ) used to practice I`tikaf in the last ten days of Ramadan and I used to pitch a tent for him, and after offering the morning prayer, he used to enter the tent." Hafsa asked the permission of `Aisha to pitch a tent for her and she allowed her and she pitched her tent. When Zainab bint Jahsh saw it, she pitched another tent. In the morning the Prophet (ﷺ) noticed the tents. He said, 'What is this?" He was told of the whole situation. Then the Prophet (ﷺ) said, "Do you think that they intended to do righteousness by doing this?" He therefore abandoned the I`tikaf in that month and practiced I`tikaf for ten days in the month of Shawwal."