Abu Saeed Khudri reported,

The Messenger of Allah ﷺ used to perform itikaf during the middle ten days of Ramadan. When the evening of the twentieth night came and the twenty-first was about to begin, he would return to his dwelling, and those who had been performing itikaf with him would also return.In one particular Ramadan, he stayed in itikaf through the night on which he would normally have returned home. He addressed the people, instructing them as Allah willed, then said, "I used to perform itikaf during these ten days, but it has now occurred to me that I should perform itikaf during the last ten. So whoever was in itikaf with me should remain in his place of seclusion. I was shown this night, but then I was made to forget it, so seek it in every odd night. I saw myself prostrating in water and mud."That very night the sky opened and rain poured down. The roof of the mosque leaked over the place where the Prophet ﷺ prayed on the twenty-first night. My own eyes saw the Messenger of Allah ﷺ, and I looked at him as he finished the dawn prayer with his face covered in mud and water.

Azami 4694

Sahih

عن أبي سعيد الخدري، قال

كان رسول الله ﷺ يجاور في رمضان العشر التي في وسط الشهر، فإذا كان حين يمسي من عشرين ليلة تمضي ويستقبل إحدى وعشرين، رجع إلى مسكنه، ورجع من كان يجاور معه، وأنه أقام في شهر جاور فيه الليلة التي كان يرجع فيها، فخطب الناس، فأمرهم ما شاء الله، ثم قال: كنت أجاور هذه العشر، ثم قد بدا لي أن أجاور هذه العشر الأواخر، فمن كان اعتكف معي فليثبت في معتكفه، وقد أريت هذه الليلة، ثم أنسيتها، فابتغوها في كل وتر، وقد رأيتني أسجد في ماء وطين. فاستهلت السماء في تلك الليلة فأمطرت، فوكف المسجد في مصلى النبي ﷺ ليلة إحدى وعشرين. فبصرت عيني رسول الله ﷺ ونظرت إليه انصرف من الصبح ووجهه ممتلئ طينا وماء.

الأعظمي 4694صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
Itikaf
Section
Itikaf in the middle ten days, then moving it to the last ten days in order to seek Laylat al-Qadr
Numbering
Jami al-Kamil 4694 (2nd edition)
Azami 4694