The sun was eclipsed during the time of the Messenger of Allah ﷺ, so the Messenger of Allah ﷺ led the people in prayer. He stood for a long time, then bowed for a long time, then stood again for a long time, though shorter than the first standing, then bowed again for a long time, though shorter than the first bowing. Then he rose and prostrated. He did the same in the second rakah.When he finished, the sun had cleared. He addressed the people, praised and glorified Allah, then said, "The sun and the moon are two of the signs of Allah. They are not eclipsed for the death of anyone or for his life. So when you see that, call upon Allah , proclaim His greatness, and give in charity."Then he said, "Community of Muhammad, no one is more jealous than Allah
that His male servant should commit fornication or His female servant should commit fornication. Community of Muhammad, by Allah, if you knew what I know, you would laugh little and weep much."
أخبرنا قتيبة عن مالك عن هشام بن عروة عن أبيه
خسفت الشمس في عهد رسول الله ﷺ فصلى رسول الله ﷺ بالناس فقام فأطال القيام ثم ركع فأطال الركوع ثم قام فأطال القيام وهو دون القيام الأول ثم ركع فأطال الركوع وهو دون الركوع الأول ثم رفع فسجد ثم فعل ذلك في الركعة الأخرى مثل ذلك ثم انصرف وقد تجلت الشمس فخطب الناس فحمد الله وأثنى عليه ثم قال إن الشمس والقمر آيتان من آيات الله لا يخسفان لموت أحد ولا لحياته فإذا رأيتم ذلك فادعوا الله عز وجل وكبروا وتصدقوا ثم قال يا أمة محمد ما من أحد أغير من الله عز وجل أن يزني عبده أو تزني أمته يا أمة محمد والله لو تعلمون ما أعلم لضحكتم قليلا ولبكيتم كثيرا
Muslim narrated it in the Book of Eclipse Prayer, Chapter on the Eclipse Prayer, no. 901, from Qutayba, and Bukhari narrated it in the Book of Eclipse Prayer, Chapter on Giving Charity During an Eclipse, no. 1044, both from the hadith of Malik, and it is also in Sunan al-Kubra, no. 1859, and in Muwatta (Yahya's recension), 1/186.