(Imām Bukhārī narrates): 'Abdullāh ibn Maslamah narrated to us, from Imām Mālik, from Hishām ibn 'Urwah, from his father, from 'Ā'ishah, may Allāh be pleased with her, she narrates that:
in the time of the Messenger of Allāh ﷺ the sun was eclipsed, so the Messenger of Allāh ﷺ led the people in prayer; so he stood for a very long time, then performed rukū', so he performed a very long rukū', then he stood, so he stood for a long time, and this standing was less than the first standing, then he performed rukū', so he performed a long rukū', and this was less than the first rukū', then he performed sajdah, so he performed a long sajdah, then he prayed the second rak'ah similar to the first rak'ah. Then he turned, and the sun had become uncovered. Then he gave a khutbah to the people, so he praised and extolled Allāh the Exalted, then said: The sun and the moon are two signs among the signs of Allāh; they are not eclipsed because of anyone's death, nor because of anyone's life. So when you see a solar eclipse, make du'ā' to Allāh, and pronounce the takbīr, and pray, and give sadaqah. Then he said: O ummah of Muhammad! By Allāh! None of you has more ghairah (protective jealousy) than Allāh, when His male servant commits zinā or His female servant commits zinā. And O ummah of Muhammad! By Allāh! If you knew what I know, you would laugh little and weep much.
Reference: Sahih Al Bukhari 1044