Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:17703Abū al-Qāsim Zayd b. Abū Hāshim al-ʿAlawī Bi-al-Kūfah > Abū Jaʿfar Muḥammad b. ʿAlī b. Duḥaym > Ibrāhīm b. ʿAbdullāh al-ʿAbsī > Wakīʿ b. al-Jarrāḥ > al-Aʿmash > Abū Ẓabyān > Ibn ʿAbbās

[Machine] Indeed, the first thing that Allah created was the pen. He said, "Write!" The pen asked, "O Lord, what shall I write?" He replied, "Write down destiny." The pen then began writing everything that will happen from that day until the Day of Judgment. Then Allah created the Noon (a reference to Prophet Muhammad) and He spread the earth on top of it. The moisture in the air rose and the heavens were created from it. The Noon moved and the earth was stretched out then stabilized by the mountains. And indeed, the mountains will crumble upon the earth until the Day of Judgment.  

البيهقي:١٧٧٠٣أَخْبَرَنَا أَبُو الْقَاسِمِ زَيْدُ بْنُ أَبِي هَاشِمٍ الْعَلَوِيُّ بِالْكُوفَةِ أنبأ أَبُو جَعْفَرٍ مُحَمَّدُ بْنُ عَلِيِّ بْنِ دُحَيْمٍ ثنا إِبْرَاهِيمُ بْنُ عَبْدِ اللهِ الْعَبْسِيُّ أنبأ وَكِيعُ بْنُ الْجَرَّاحِ عَنِ الْأَعْمَشِ عَنْ أَبِي ظَبْيَانَ عَنِ ابْنِ عَبَّاسٍ قَالَ

إِنَّ أَوَّلَ مَا خَلَقَ اللهُ ﷻ مِنْ شَيْءٍ الْقَلَمُ فقَالَ اكْتُبْ قَالَ يَا رَبِّ وَمَا أَكْتُبُ؟ قَالَ اكْتُبِ الْقَدَرَ قَالَ فَجَرَى بِمَا هُوَ كَائِنٌ مِنْ ذَلِكَ الْيَوْمِ إِلَى قِيَامِ السَّاعَةِ قَالَ ثُمَّ خَلَقَ النُّونَ فَدَحَا الْأَرْضَ عَلَيْهَا فَارْتَفَعَ بُخَارُ الْمَاءِ فَفَتَقَ مِنْهُ السَّمَاوَاتِ وَاضْطَرَبَ النُّونُ فَمَادَتِ الْأَرْضُ فَأُثْبِتَتْ بِالْجِبَالِ وَإِنَّ الْجِبَالَ لَتُفَجَّرُ عَلَى الْأَرْضِ إِلَى يَوْمِ الْقِيَامَةِ  


See similar narrations below:

Collected by Ḥākim
hakim:3840Abū Zakariyyā Yaḥyá b. Muḥammad al-ʿAnbarī > Muḥammad b. ʿAbd al-Salām > Isḥāq b. Ibrāhīm > Jarīr > al-Aʿmash > Abū Ẓabyān > Ibn ʿAbbās > In Awwal Shayʾ Khalqah Allāh al-Qalam > Lah Āktub > And Mā Aktub > al-Qadar

[Machine] Indeed, the first thing that Allah created was the pen. He said to it, "Write." It asked, "What should I write?" He replied, "Write the destiny." From that day, everything that exists will continue until the Day of Judgment. It is said that His throne was over the water, and the steam from the water rose and the skies were created. Then He created the "Noon" and spread the earth upon it. The earth rested upon the back of the Noon and the Noon shuddered. The earth solidified and was established with mountains. Indeed, the mountains elevate on the surface of the earth.  

الحاكم:٣٨٤٠أَخْبَرَنَا أَبُو زَكَرِيَّا يَحْيَى بْنُ مُحَمَّدٍ الْعَنْبَرِيُّ ثنا مُحَمَّدُ بْنُ عَبْدِ السَّلَامِ ثنا إِسْحَاقُ بْنُ إِبْرَاهِيمَ أَنْبَأَ جَرِيرٌ عَنِ الْأَعْمَشِ عَنْ أَبِي ظَبْيَانَ عَنِ ابْنِ عَبَّاسٍ قَالَ

إِنَّ أَوَّلَ شَيْءٍ خَلْقَهُ اللَّهُ الْقَلَمُ فَقَالَ لَهُ اكْتُبْ فَقَالَ وَمَا أَكْتُبُ؟ فَقَالَ الْقَدَرُ فَجَرَى مِنْ ذَلِكَ الْيَوْمِ بِمَا هُوَ كَائِنٌ إِلَى أَنْ تَقُومَ السَّاعَةُ قَالَ وَكَانَ عَرْشُهُ عَلَى الْمَاءِ فَارْتَفَعَ بُخَارُ الْمَاءِ فَفُتِقَتْ مِنْهُ السَّمَاوَاتُ ثُمَّ خَلَقَ النُّونَ فَبُسِطَتِ الْأَرْضُ عَلَيْهِ وَالْأَرْضُ عَلَى ظَهْرِ النُّونِ فَاضْطَرَبَ النُّونُ فَمَادَتِ الْأَرْضُ فَأُثْبِتَتْ بِالْجِبَالِ فَإِنَّ الْجِبَالَ تَفْخَرُ عَلَى الْأَرْضِ  

«هَذَا حَدِيثٌ صَحِيحٌ عَلَى شَرْطِ الشَّيْخَيْنِ وَلَمْ يُخَرِّجَاهُ» على شرط البخاري ومسلم