‘Aisha (RA) reported that: “Allah’s Apostle used to practice Itikaf in the last ten nights of Ramadan and used to say, “Look for the Night of Qadr in the last ten nights of the month of Ramadan,”"
(Sahih Bukhari, Book #32, Hadith #237)
Abu Huraira (RA) reported that: “The Prophet used to perform Itikaf every year in the month of Ramadan for ten days, and when it was the year of his death, he stayed in Itikaf for twenty days.”
(Sahih Bukhari, Book #33, Hadith #260)
Abu Salama reported that: “Once I went to Abu- Sa’id Al-Khudri and asked him, “Won’t you come with us to the date-palm trees to have a talk?” So Abu Said went out and I asked him, “Tell me what you heard from the Prophet about the Night of Qadr.” Abu Sa’id replied, “Once Allah’s Apostle performed I’tikaf (seclusion) on the first ten days of the month of Ramadan and we did the same with him. Jibreel (AS) came to him and said, ‘The night you are looking for is ahead of you.’ So the Prophet performed the I’tikaf in the middle (second) ten days of the month of Ramadan and we too performed I’tikaf with him. Jibreel (AS) came to him and said, ‘The night which you are looking for is ahead of you.’ In the morning of the 20th of Ramadan the Prophet delivered a sermon saying, ‘Whoever has performed I’tikaf with me should continue it. I have been shown the Night of “Qadr”, but have forgotten its date (or I was caused to forget it), but it is in the odd nights of the last ten nights. I saw in my dream that I was prostrating in mud and water.’ In those days the roof of the mosque was made of branches of date-palm trees. At that time the sky was clear and no cloud was visible, but suddenly a cloud came and it rained. The Prophet led us in the prayer and I saw the traces of mud on the forehead and on the nose of Allah’s Apostle. So it was the confirmation of that dream.”"
(Sahih Bukhari, Book #12, Hadith #777)
'A'isha (Allah be pleased with her) reported that the Messenger of Allah (may peace he upon him) used to observe i'tikif in the last ten days of Ramadan till Allah called him back (to his heavenly home). Then his wives observed i'tikaf after him.