Sahih al-Bukhari Book 33, Hadith 9
The Prophet (ﷺ) intended to practice I`tikaf and when he reached the place where he intended to perform
I`tikaf, he saw some tents, the tents of `Aisha, Hafsa and Zainab. So, he said, "Do you consider that
they intended to do righteousness by doing this?" And then he went away and did not perform I`tikaf
(in Ramadan) but performed it in the month of Shawwal for ten days.
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."
Safiya, the wife of the Prophet (ﷺ) told me that she went to Allah's Messenger (ﷺ) to visit him in the mosque while he was in I`tikaf in the last ten days of Ramadan. She had a talk with him for a while, then she got up in order to return home. The Prophet (ﷺ) accompanied her. When they reached the gate of the mosque, opposite the door of Um-Salama, two Ansari men were passing by and they greeted Allah's Apostle . He told them: Do not run away! And said, "She is (my wife) Safiya bint Huyai." Both of them said, "Subhan Allah, (How dare we think of any evil) O Allah's Messenger (ﷺ)!" And they felt it. The Prophet said (to them), "Satan reaches everywhere in the human body as blood reaches in it, (everywhere in one's body). I was afraid lest Satan might insert an evil thought in your minds."