Tafsir Ibn Kathir -> Surah Al-A'raf -> Musa fasts and worships Allah for Forty Days

Allah reminds the Children of Israel of the guidance that He sent to them by speaking directly to Musa and revealing the Tawrah to him. In it, was their law and the details of their legislation. Allah stated here that He appointed thirty nights for Musa. The scholars of Tafsir said that Musa fasted this period, and when they ended, Musa cleaned his teeth with a twig. Allah commanded him to complete the term adding ten more days, making the total forty. When the appointed term finished, Musa was about to return to Mount Tur, as Allah said,

﴿يبَنِى إِسْرَءِيلَ قَدْ أَنجَيْنَـكُمْ مِّنْ عَدُوِّكُمْ وَوَاعَدْنَـكُمْ جَانِبَ الطُّورِ الاٌّيْمَنَ﴾

(O Children of Israel! We delivered you from your enemy, and We made a covenant with you on the right side of the Mount) ﴿20:80﴾. Musa left his brother Harun with the Children of Israel and commanded him to use wisdom and refrain from mischief. This was only a reminder, for Harun was an honorable and noble Prophet who had grace and exalted standard with Allah, may Allah's peace and blessings be upon him and the rest of the Prophets.

﴿وَلَمَّا جَآءَ مُوسَى لِمِيقَـتِنَا وَكَلَّمَهُ رَبُّهُ قَالَ رَبِّ أَرِنِى أَنظُرْ إِلَيْكَ قَالَ لَن تَرَانِى وَلَـكِنِ انْظُرْ إِلَى الْجَبَلِ فَإِنِ اسْتَقَرَّ مَكَانَهُ فَسَوْفَ تَرَانِى فَلَمَّا تَجَلَّى رَبُّهُ لِلْجَبَلِ جَعَلَهُ دَكًّا وَخَرَّ موسَى صَعِقًا فَلَمَّآ أَفَاقَ قَالَ سُبْحَـنَكَ تُبْتُ إِلَيْكَ وَأَنَاْ أَوَّلُ الْمُؤْمِنِينَ ﴾

(143. And when Musa came at the time and place appointed by Us, and his Lord (Allah) spoke to him; he said: "O my Lord! Show me (Yourself), that I may look upon You.'' Allah said: "You cannot see Me, but look upon the mountain; if it stands still in its place then you shall see Me.'' So when his Lord appeared to the mountain, He made it collapse to dust, and Musa fell down unconscious. Then when he recovered his senses he said: "Glory be to You, I turn to You in repentance and I am the first of the believers.'')