Praise be to Allah.
Itikaaf is prescribed according to the Quraan and Sunnah and scholarly consensus.
In the Quraan, Allah says (interpretation of the meaning):
|and We commanded Ibraaheem (Abraham) and Ismaaeel (Ishmael) that they should purify My House (the Kabah at Makkah) for those who are circumambulating it, or staying (Itikaaf), or bowing or prostrating themselves (there, in prayer) [al-Baqarah 2:125]|
|And do not have sexual relations with them (your wives) while you are in Itikaaf (i.e. confining oneself in a mosque for prayers and invocations leaving the worldly activities) in the mosques [al-Baqarah 2:187]|
With regard to the Sunnah, there are many ahaadeeth, such as the hadeeth of Aaishah (may Allah be pleased with her) who said that the Prophet ﷺ used to observe i’tikaaf during the last ten days of Ramadaan until Allah took his soul, then his wives observed itikaaf after he was gone. Narrated by al-Bukhaari, 2026; Muslim, 1172.
With regard to scholarly consensus, more than one of the scholars narrated that there was scholarly consensus that itikaaf is prescribed in shareeah, such as al-Nawawi, Ibn Qudaamah, Shaykh al-Islam Ibn Taymiyah, and others.
See al-Majmoo, 6/404; al-Mughni, 4/456; Sharh al-Umdah, 2/711.
Shaykh Ibn Baaz said in Majmoo al-Fataawa, 15/437:
|Undoubtedly itikaaf in the mosque is an act of worship, and (observing it) in Ramadaan is better than at other times. It is prescribed in Ramadaan and at other times|
The ruling on itikaaf.
The basic principle is that itikaaf is Sunnah, not obligatory, unless one made a vow to do it, in which case it becomes obligatory, because the Prophet ﷺ said
| Whoever vows to obey Allah, let him obey Him, and whoever vows to disobey Him, let him not disobey Him. Narrated by al-Bukhaari, 6696.|
And Umar (may Allah be pleased with him) said:
| O Messenger of Allah, during the Jaahiliyyah I vowed to observe itikaaf for one night in al-Masjid al-Haraam. He said: Fulfil your vow. (6697).|
Ibn al-Mundhir said in his book al-Ijmaa (p. 53):
|They were unanimously agreed that itikaaf is Sunnah and is not obligatory unless a man obliges himself to do that by making a vow, in which case it becomes obligatory for him.|
Taken from islamqa.info
See Fiqh al-Itikaaf by Dr Khaalid al-Mushayqih, p. 31.(NOTE: If you want to build a strong and powerful relationship with Allah, check out Islamia TV, where you can watch Islamic speakers from across the globe deliver inspiring and motivational courses. Learn more at www.islamia.tv.)