أَخْبَرَنَا عَلِيُّ بْنُ أَحْمَدَ بْنِ عَبْدَانَ ، أَخْبَرَنَا أَحْمَدُ بْنُ عُبَيْدٍ الصَّفَّارُ ، حَدَّثَنَا عُبَيْدُ بْنُ شَرِيكٍ ، حَدَّثَنَا يَحْيَى ، حَدَّثَنَا اللَّيْثُ ، عَنْ عُقَيْلٍ ، عَنِ ابْنِ شِهَابٍ ، عَنْ عُرْوَةَ بْنِ الزُّبَيْرِ ، عَنْ عَائِشَةَ ، زَوْجِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ كَانَ يَعْتَكِفُ الْعَشْرَ الْأَوَاخِرَ مِنْ رَمَضَانَ حَتَّى تَوَفَّاهُ اللَّهُ ، ثُمَّ اعْتَكَفَ أَزْوَاجُهُ مِنْ بَعْدِهِ .
وَالسُّنَّةُ فِي الْمُعْتَكِفِ أَنْ لَا يَخْرُجَ إِلَّا لِلْحَاجَةِ الَّتِي لَا بُدَّ مِنْهَا ، وَلَا يَعُودُ مَرِيضًا ، وَلَا يَمَسَّ امْرَأَةً ، وَلَا يُبَاشِرْهَا ، وَلَا اعْتِكَافَ إِلَّا فِي مَسْجِدِ جَمَاعَةٍ ، وَالسُّنَّةُ فِي الْمُعْتَكِفِ أَنْ يَصُومَ .
أَخْرَجَاهُ فِي الصَّحِيحِ مِنْ حَدِيثِ اللَّيْثِ دُونَ قَوْلِهِ ، وَالسُّنَّةُ فِي الْمُعْتَكِفِ إِلَى آخِرَهِ فَقَدْ قِيلَ إِنَّهُ مِنْ قَوْلِ عُرْوَةَ وَاللَّهُ أَعْلَمُ .
It is narrated from the Mother of the Believers Sayyidah Aishah (may Allah be pleased with her), the wife of the Prophet (peace and blessings be upon him), that the Prophet (peace and blessings be upon him) used to observe i'tikaf in the last ten days of Ramadan until Allah Almighty took him in death; then after him (peace and blessings be upon him), his (peace and blessings be upon him) pure wives continued to observe i'tikaf.
And the Sunnah for the one in i'tikaf is that he does not go out (of the mosque) except for a need that cannot be avoided, that he does not visit a sick person, does not touch a woman, and does not have relations with her; and there is no i'tikaf except in a congregational mosque (a mosque where congregational prayer is held); and the Sunnah for the one in i'tikaf is that he fasts.
Imam al-Bukhari and Imam Muslim (may Allah have mercy on them both) recorded it in the "Sahih" through the hadith of al-Layth (may Allah have mercy on him), but without the words from "And the Sunnah for the one in i'tikaf" to the end; it has been said that this is the saying of Urwah (may Allah have mercy on him), and Allah knows best.