Sunan an-Nasa'i, Book 16, Hadith 32 (In-Book) ⓘ
It was narrated from An-Nu'man bin Bashir that : The Prophet came rushing out to the masjid one day when the sun eclipsed, and he prayed until the eclipse ended, then he said: "The people of Jahilliyyah used to say that eclipses of the sun and the moon only happened when some great man on earth died. But eclipses of the sun and the moon do not happen for the death or birth of anyone. Rather they are two of the creations of Allah (SWT) and Allah (SWT) causes to happen in His creation what He wills. Whichever of them becomes eclipsed, pray until it is over or Allah (SWT) causes something to happen."
أَخْبَرَنَا مُحَمَّدُ بْنُ بَشَّارٍ، قَالَ حَدَّثَنَا مُعَاذُ بْنُ هِشَامٍ، قَالَ حَدَّثَنِي أَبِي، عَنْ قَتَادَةَ، عَنِ الْحَسَنِ، عَنِ النُّعْمَانِ بْنِ بَشِيرٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم أَنَّهُ خَرَجَ يَوْمًا مُسْتَعْجِلاً إِلَى الْمَسْجِدِ وَقَدِ انْكَسَفَتِ الشَّمْسُ فَصَلَّى حَتَّى انْجَلَتْ ثُمَّ قَالَ " إِنَّ أَهْلَ الْجَاهِلِيَّةِ كَانُوا يَقُولُونَ إِنَّ الشَّمْسَ وَالْقَمَرَ لاَ يَنْخَسِفَانِ إِلاَّ لِمَوْتِ عَظِيمٍ مِنْ عُظَمَاءِ أَهْلِ الأَرْضِ وَإِنَّ الشَّمْسَ وَالْقَمَرَ لاَ يَنْخَسِفَانِ لِمَوْتِ أَحَدٍ وَلاَ لِحَيَاتِهِ وَلَكِنَّهُمَا خَلِيقَتَانِ مِنْ خَلْقِهِ يُحْدِثُ اللَّهُ فِي خَلْقِهِ مَا يَشَاءُ فَأَيُّهُمَا انْخَسَفَ فَصَلُّوا حَتَّى يَنْجَلِيَ أَوْ يُحْدِثَ اللَّهُ أَمْرًا " .
also referenced under: Hadith 1490 (Reference) & Volume 2, Book 16, Hadith 1491 (DarusSalam)