Abu Hurairah reported,

The Messenger of Allah ﷺ forbade continuous fasting without breaking it. Some men from the Muslims said to him, "But you, Messenger of Allah, practice continuous fasting."The Messenger of Allah ﷺ replied, "Which of you is like me? I spend the night with my Lord feeding me and giving me drink."When they refused to stop continuous fasting, he fasted with them continuously for one day, then another day, then they saw the crescent moon. He said, "Had it been delayed, I would have continued with you longer," as a way of disciplining them when they refused to stop.Shuayb, Yahya bin Saeed, and Yunus followed him in narrating this from Zuhri. Abdul-Rahman bin Khalid reported from Ibn Shihab, from Saeed, from Abu Hurairah, from the Prophet ﷺ.

Bukhari 6851

Sahih

حدثنا يحيى بن بكير حدثنا الليث عن عقيل عن ابن شهاب حدثنا أبو سلمة أن

أبا هريرة رضي الله عنه قال

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

البخاري 6851صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Legal punishments
Chapter
How much discretionary punishment and discipline
Numbering
Darussalam 6851
Bukhari 6851