Yahya related to me from Malik that he had heard that al-Qasim ibn Muhammad and Nafi, the mawla of Abdullah ibn Umar said, "You cannot do itikaf unless you are fasting, because of what Allah, the Blessed and Exalted, says in His Book, 'And eat and drink until the white thread becomes clear to you from the black thread of dawn, then complete the fast until night-time, and do not have intercourse with them while you are doing itikaf in mosques,' (Sura 2 ayat 187). Allah only mentions itikaf together with fasting." Malik said, "That is what we go by here."
قَالاَ لاَ اعْتِكَافَ إِلاَّ بِصِيَامٍ بِقَوْلِ اللَّهِ تَبَارَكَ وَتَعَالَى فِي كِتَابِهِ وَكُلُوا وَاشْرَبُوا حَتَّى يَتَبَيَّنَ لَكُمُ الْخَيْطُ الأَبْيَضُ مِنَ الْخَيْطِ الأَسْوَدِ مِنَ الْفَجْرِ ثُمَّ أَتِمُّوا الصِّيَامَ إِلَى اللَّيْلِ وَلاَ تُبَاشِرُوهُنَّ وَأَنْتُمْ عَاكِفُونَ فِي الْمَسَاجِدِ فَإِنَّمَا ذَكَرَ اللَّهُ الاِعْتِكَافَ مَعَ الصِّيَامِ قَالَ مَالِكٌ وَعَلَى ذَلِكَ الأَمْرُ عِنْدَنَا أَنَّهُ لاَ اعْتِكَافَ إِلاَّ بِصِيَامٍ