Sayyiduna Anas bin Malik (may Allah be pleased with him) narrates that the Noble Prophet (peace and blessings be upon him) used to observe i'tikaf during the last ten days of Ramadan. Then, one year he traveled and could not observe i'tikaf, so the following year he observed i'tikaf for twenty nights.