Sayyiduna Abu Sa'id (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) observed i'tikaf in the middle ten (days) of Ramadan, seeking Laylat al-Qadr before it was made clear to him. When the ten were over, he (peace and blessings be upon him) ordered the tent to be dismantled, and it was taken down. Then it was made clear to him that it is in the last ten, so he ordered the tent and it was set up again in its place, and he (peace and blessings be upon him) observed i'tikaf in the last ten. He (peace and blessings be upon him) came out to us and said: "O people, I was informed of Laylat al-Qadr, and I came out to tell you about it, but two men were quarrelling, disputing their rights, and Satan was with them, so I was made to forget it. So seek it on the ninth, the seventh and the fifth (nights)."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 8532