The Prophet Muhammad (peace be upon him) regularly performed I'tikaf, or spiritual retreat, in the mosque during Ramadan. He would spend the last ten days of Ramadan in I'tikaf each year seeking Laylat al-Qadr. I'tikaf provides benefits such as protecting the heart from distractions and allowing one to focus on worshipping Allah. The Prophet (peace be upon him) advised combining I'tikaf with fasting, as fasting also shields the heart. He taught that I'tikaf should be entered before sunset to be valid. His guidance on I'tikaf is the most perfect teaching.