Anas bin Malik reported,

The Messenger of Allah ﷺ was praying during Ramadan, so I came and stood beside him. Then another man came and stood with us as well, until we became a small group. When the Prophet ﷺ sensed that we were behind him, he began to shorten the prayer. Then he went into his dwelling and prayed a prayer there that he had not prayed in our presence.When morning came, we said to him, "Did you notice us last night?"He replied, "Yes, that is what led me to do what I did."Then the Messenger of Allah ﷺ began to fast continuously without breaking his fast, and this was at the end of the month. Some men from among his companions also began to fast continuously, so the Prophet ﷺ said, "What is the matter with some men who fast continuously? You are not like me. By Allah, if the month were extended for me, I would continue fasting in such a way that those who go to extremes would abandon their extremism."

Muslim 2570

Sahih

حدثني زهير بن حرب حدثنا أبو النضر هاشم بن القاسم حدثنا سليمان عن ثابت

عن أنس رضي الله عنه قال

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

مسلم 2570صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Fasting
Chapter
Prohibition of continuous fasting
Numbering
Darussalam 2570
Muslim 2570