Sayyiduna Anas (may Allah be pleased with him) narrates: When the Prophet (peace and blessings be upon him) was residing, he used to observe i'tikaf during the last ten days of Ramadan, and when he was in a state of travel, then in the following year he would observe i'tikaf for twenty days.