Ayesha reported,

The Messenger of Allah ﷺ used to encourage people to pray during the nights of Ramadan without commanding them to do so as a binding obligation. He would say, "Whoever stands in prayer during Ramadan out of faith and seeking reward, his past sins will be forgiven."In another narration, he went out in the middle of the night to pray in the mosque, and the people prayed along with him. The narrator continued the hadith, including the following, He used to encourage them to pray during the nights of Ramadan without commanding them as a binding obligation, saying, "Whoever stands in prayer on Laylat al-Qadr out of faith and seeking reward, his past sins will be forgiven."The narrator said, "The Messenger of Allah ﷺ passed away while the matter remained as such."

Azami 4638

Sahih

عن عائشة، قالت

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

الأعظمي 4638صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
Night prayer in Ramadan
Section
Encouragement to pray at night during Ramadan without making it obligatory
Numbering
Jami al-Kamil 4638 (2nd edition)
Azami 4638