Short answer
In the Hanafi school the sunnah itikaf of the last ten days breaks by leaving the masjid without a valid need, by intercourse (even at night or forgetfully), by ejaculation from kissing or touching, by breaking the fast, and for women by the start of a period. If it breaks, make up one day of itikaf with a fast later, and you may stay on as a nafl itikaf.
Because the sunnah and vowed itikaf require fasting, anything that breaks the fast breaks them, except forgetful eating. Intercourse breaks itikaf at any hour; kissing and touching with desire are haram in itikaf and break it if ejaculation follows. A broken sunnah itikaf is made up for one day, with fasting.
Other madhhabs
- Shafi'i
- Fasting is not a condition of itikaf, so breaking the fast does not break it; intercourse and ejaculation from touching do.
- Hanbali
- Fasting is not a condition, and a voluntary itikaf that is broken does not have to be made up.
Explanation
Allah says: do not have relations with your wives while you are staying in the masjids for worship. This, and the rules on leaving the masjid, are the core of what breaks itikaf.
Breaks the sunnah itikaf:
- Leaving the masjid without a valid need, even briefly. See leaving the masjid.
- Intercourse, by day or night, deliberately or forgetfully.
- Ejaculation from kissing, touching or embracing.
- Breaking the fast for any reason, such as illness or a mistake about the time.
- For a woman, the start of her period or postnatal bleeding.
- Losing one's reason for a long period.
Does not break it: eating forgetfully, a wet dream (go out for ghusl if there is no facility inside), sleeping, eating and drinking in the masjid at night, talking about permitted things, a short necessary phone call.
If it breaks. The sunnah itikaf of the remaining days is lost, because it needed the full ten. In the Hanafi fatwa you make up one day of itikaf, with a fast, at any time later, even outside Ramadan. You may stay on in the masjid for the rest of the ten days as a nafl itikaf, and you still gain the reward of worship and of seeking Laylatul Qadr.
What to avoid even when it does not break: needless worldly talk, arguments, trading inside the masjid and wasting the nights on the phone. See the itikaf guide and when itikaf starts.
The evidence
Quran, Surah Al-Baqara 2:187
أُحِلَّ لَكُمْ لَيْلَةَ ٱلصِّيَامِ ٱلرَّفَثُ إِلَىٰ نِسَآئِكُمْ ۚ هُنَّ لِبَاسٌۭ لَّكُمْ وَأَنتُمْ لِبَاسٌۭ لَّهُنَّ ۗ عَلِمَ ٱللَّهُ أَنَّكُمْ كُنتُمْ تَخْتَانُونَ أَنفُسَكُمْ فَتَابَ عَلَيْكُمْ وَعَفَا عَنكُمْ ۖ فَٱلْـَٰٔنَ بَٰشِرُوهُنَّ وَٱبْتَغُوا۟ مَا كَتَبَ ٱللَّهُ لَكُمْ ۚ وَكُلُوا۟ وَٱشْرَبُوا۟ حَتَّىٰ يَتَبَيَّنَ لَكُمُ ٱلْخَيْطُ ٱلْأَبْيَضُ مِنَ ٱلْخَيْطِ ٱلْأَسْوَدِ مِنَ ٱلْفَجْرِ ۖ ثُمَّ أَتِمُّوا۟ ٱلصِّيَامَ إِلَى ٱلَّيْلِ ۚ وَلَا تُبَٰشِرُوهُنَّ وَأَنتُمْ عَٰكِفُونَ فِى ٱلْمَسَٰجِدِ ۗ تِلْكَ حُدُودُ ٱللَّهِ فَلَا تَقْرَبُوهَا ۗ كَذَٰلِكَ يُبَيِّنُ ٱللَّهُ ءَايَٰتِهِۦ لِلنَّاسِ لَعَلَّهُمْ يَتَّقُونَ ﴿١٨٧﴾
It has been made permissible for you the night preceding fasting to go to your wives [for sexual relations]. They are clothing for you and you are clothing for them. Allah knows that you used to deceive yourselves, so He accepted your repentance and forgave you. So now, have relations with them and seek that which Allah has decreed for you. And eat and drink until the white thread of dawn becomes distinct to you from the black thread [of night]. Then complete the fast until the sunset. And do not have relations with them as long as you are staying for worship in the mosques. These are the limits [set by] Allah, so do not approach them. Thus does Allah make clear His ordinances to the people that they may become righteous.
Intimacy is forbidden during itikaf.
Sunan Abi Dawud 2473
Grading to be checked... السنة على المعتكف أن لا يعود مريضا ولا يشهد جنازة ولا يمس امرأة ولا يباشرها ...
"The sunnah for the one in itikaf is not to visit the sick, not to attend a funeral, and not to touch or be intimate with his wife."
Aisha's description of the limits of itikaf.
Sahih al-Bukhari 2029
Sahih... وكان لا يدخل البيت إلا لحاجة إذا كان معتكفا ...
"He would not enter the house except for a need when he was in itikaf."
Leaving the masjid is only for necessity.
Where the ruling is recorded
- al-Hidaya, Kitab al-Sawm, chapter on itikaf. Intercourse breaks itikaf by day or night; kissing and touching break it only with ejaculation.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Sawm, chapter on itikaf. A broken sunnah itikaf is made up for the day in which it broke, with fasting.
- al-Mughni (Ibn Qudama), Kitab al-I'tikaf. The Hanbali view that fasting is not a condition of itikaf.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.