Allāh swt said:
وَمَا أَرْسَلْنَاكَ إِلا رَحْمَةً لِّلْعَالَمِينَWe sent thee not, but as a Mercy for all creatures. (al-Anbīyā’ 21:107) There are two meanings for the Arabic ‘alamīn. ‘Alamīn can refer to humankind and jinn. It can also mean everyone and everything. Everything that Allāh (swt) has created is included in ‘alamīn. As Allāh said in the opening of the Qur’ān (Sūrat al-Fātiha):
الْحَمْدُ للّهِ رَبِّ الْعَالَمِينَAll praise is for Allah Lord of the Worlds. (al-Fātiha 1:1) ‘Alamīn means Allāh (swt)s the Lord of everything. The Prophet (s) as a mercy to the worlds (‘alamīn) is correspondingly sent as a mercy to all of Allāh’s creation. Anything and everything that is other than Allāh (swt)s a recipient of His mercy and blessings through the Prophet (s) .
رواه عبد الرزاق بسنده عن جابر بن عبد الله بلفظ قال قلت: يا رسول الله، بأبي أنت وأمي، أخبرني عن أول شيء خلقه الله قبل الأشياء. قال: يا جابر، إن الله تعالى خلق قبل الأشياء نور نبيك من نوره، فجعل ذلك النور يدور بالقُدرة حيث شاء الله، ولم يكن في ذلك الوقت لوح ولا قلم ولا جنة ولا نار ولا ملك ولا سماء ولا أرض ولا شمس ولا قمر ولا جِنِّيٌ ولا إنسي، فلما أراد الله أن يخلق الخلق قسم ذلك النور أربعة أجزاء: فخلق من الجزء الأول القلم، ومن الثاني اللوح، ومن الثالث العرش، ثم قسم الجزء الرابع أربعة أجزاء، فخلق من الجزء الأول حَمَلَة العرش، ومن الثاني الكرسي، ومن الثالث باقي الملائكة، ثم قسم الجزء الرابع أربعة أجزاء: فخلق من الأول السماوات، ومن الثاني الأرضين، ومن الثالث الجنة والنار، ثم قسم الرابع أربعة أجزاء، فخلق من الأول نور أبصار المؤمنين، ومن الثاني نور قلوبهم وهى المعرفة بالله، ومن الثالث نور إنسهم وهو التوحيد لا إله إلا الله محمد رسول الله. الحديث. كذا في المواهب
It is related that Jābir ibn ‘Abd Allāh (r) said to the Prophet (s), “O Messenger of Allāh, may my father and mother be sacrificed for you, tell me of the first thing Allāh created before all things.” He said: O Jābir, the first thing Allāh created was the light of your Prophet from His light, and that light remained in the midst of His Power for as long as He wished, and there was not, at that time, a Tablet or a Pen or a Paradise or a Fire or an angel or a heaven or an earth. And when Allāh wished to create creation, he divided that Light into four parts and from the first made the Pen, from the second the Tablet, from the third the Throne, then He divided the fourth into four parts [and from them created everything else].
The Prophet (s) told Jābir (r), “O Jābir! The first thing that Allāh created is the light of your Prophet.” If we heed what modern physics is teaching us, then that light must be the source of the great Big Bang. Physicists say that before that event, there was nothing. Then Allāh said, “Kun―Be!” and “it was―fayakūn.”
When the Prophet (s) says, “The first thing that Allāh created is my light,” and from it whatever else Allāh has created as mentioned in the hadith above. Indeed, Allāh (swt) has favored everyone by creating them from the light of the Prophet (s). This follows from Allāh’s saying, “We have sent you (O Prophet) not but as a mercy to humanity (or the worlds).” For from the Light of the Prophet (s), Allāh made the Pen, the Tablet, the Throne, then everything else in material existence. The Prophet (s) said, “That light turned in the midst of His Power for as long as He wished.” Allāh caused that light to turn (yadurr) around the Essence of the Divine Attribute of Power―Allāh’s Ocean of Power―just as people circumambulate around the Ka‘ba, and just as electrons turn around the nucleus of the atom.
If the essence of all creation comes from the Divine Light, then all existence is the result of the Mercy of Allāh (swt). Indeed, this follows as a matter of logical necessity because there is no grantor of mercy (rahmān) except there also exists a marhūm―something which receives mercy. In short, nothing that exists escapes being an object of Divine Mercy. Mercy is the ocean in which all creation swims. The Ocean of Power is from the Essence―no one knows the reality of this, not even the Prophet (s). This, of course, is the meaning of, Allāhu wahdahu lā sharīka lah―Allāh (swt)s One with no partner and,
لَيْسَ كَمِثْلِهِ شَيْءٌ وَهُوَ السَّمِيعُ البَصِيرُThere is nothing whatever like unto Him, and He is the One that hears and sees (all things), (ash-Shūra 42:11) and,
سُبْحَانَ اللَّهِ عَمَّا يَصِفُونَGlory to Allah. (He is free) from the (sort of) things they attribute to Him! (al-Muminūn 23:91)
Here Allāh (swt) names the Divine Essence. Allāh (swt) revealed what He wished of the knowledge of His Attributes, Names and Acts to the Prophet (s), but knowledge of His Absolute Essence He did not show to anyone. Thus, He says, “there is nothing whatever like unto Him, and He is the One that hears and sees (all things),” asserting the unknowability of His Essence but at the same time affirming His Attributes, some of which knowledge of Himself He, in His Bounty, revealed to humankind through the agency of His Prophet (s) . According to the hadith transmitted on the authority of Ibn ‘Abbās (r), the Muhammadan Light goes from prophet to prophet (min nabīyyin ila nabīyyin) until the moment when Allāh (swt) causes it to emerge (akhraja) as the historical Prophet Muhammad.
In explaining this tremendous aspect of our beloved Prophet Muhammad (s), Shaykh ‘Abd al-Qādir Jilānī, (d. 561) in his book Sirr al-asrār fi mā yahtāju ilayh al-abrār said:
Know that since Allāh first created the soul of Muhammad (s) from the light of His beauty, as He said: I created Muhammad from the light of My Face, and as the Prophet said: The first thing Allāh created is my soul, and the first thing Allāh created is the Pen, and the first thing Allāh created is the Intellect - what is meant by all this is one and the same thing, and that is the haqīqa muhammadīyya. However, it was named a light because it is completely purified from darkness, as Allāh said, “There has come to you from Allah a Light and a manifest Book.”
It was also named "an intellect" because it is the cause for the transmission of knowledge, and the pen is its medium in the world of letters. The Muhammadan soul (al-rūh al-muhammadīyya) is therefore the quintessence of all created things and the first of them and their origin, as the Prophet said: I am from Allāh and the believers are from me, and Allāh created all souls from me in the spiritual world and He did so in the best form. It is the name of the totality of mankind in that primordial world, and after its creation by four thousand years, Allāh created the Throne from the light of Muhammad himself, and from it the rest of creation.
However, what Allāh (swt) created and gave to the Prophet (s) at that time no one knows. He said:
اللَّهُ نُورُ السَّمَاوَاتِ وَالأرْضِ مَثَلُ نُورِهِ كَمِشْكَاةٍ فِيهَا مِصْبَاحٌ الْمِصْبَاحُ فِي زُجَاجَةٍ الزُّجَاجَةُ كَأَنَّهَا كَوْكَبٌ دُرِّيٌّ يُوقَدُ مِن شَجَرَةٍ مُّبَارَكَةٍ زَيْتُونِةٍ لا شَرْقِيَّةٍ وَلا غَرْبِيَّةٍ يَكَادُ زَيْتُهَا يُضِيءُ وَلَوْ لَمْ تَمْسَسْهُ نَارٌ نُّورٌ عَلَى نُورٍ يَهْدِي اللَّهُ لِنُورِهِ مَن يَشَاءُ وَيَضْرِبُ اللَّهُ الأمْثَالَ لِلنَّاسِ وَاللَّهُ بِكُلِّ شَيْءٍ عَلِيمٌAllah is the Light of the heavens and the earth. The similitude of His light is as a niche wherein is a lamp. The lamp is in a glass. The glass is as it were a shining star. (This lamp is) kindled from a blessed tree, an olive neither of the East nor of the West, whose oil would almost glow forth (of itself) though no fire touched it. Light upon light. Allah guideth unto His light whom He will. And Allah speaketh to mankind in allegories, for Allah is Knower of all things. (an-Nūr 24: 35)
“Allah is the light of the heavens and the earth,” means He is the Creator of everything other than Himself. Whatever is other than Allāh (swt)s called mā siwa-Allāh. Allāh created everything: the Pen, heavens, earth, paradise, angels, universes, galaxies, stars, planets and the smallest objects. “And the similitude to His light,” is given by Allāh as an example for us to understand as, “a niche wherein is a lamp.” Mishkāt is usually translated as niche, but in fact it is a bundle like those in which garlic comes, tied together. “Mathalu nūrihi ka mishkātin,” can be translated, “the example of His light is like a bundle.” Within the bundle there is a misbāh. Misbāh comes from sabah, meaning an instrument that produces light, as in His saying to the Prophet Lūt (as):
أَلَيْسَ الصُّبْحُ بِقَرِيبٍIs not the light of dawn near? (Hūd 11:81) K‘ab al-Āhbar (r) makes the entire verse refer to Muhammad (s)―it is a metaphor of the light of Muhammad. The Messenger of Allāh (s) is the niche, the lamp is prophethood, the glass is his heart, the blessed tree is the revelation and the angels who brought it, the oil are the proofs and evidence which contain the revelation. True scholars and awlīyā’ say that this verse refers to the Prophet (s). ‘Alī al-Qārī in commenting upon the Prophet's title:
سِرَاجاً مُّنِيراًa Lamp spreading Light, (al-Ahzāb 33:46)
Muhammad... is a tremendous light and the source of all lights, he is also a book that gathers up and makes clear all the secrets... sirājan munīran means a luminous sun, because of His saying:
تَبَارَكَ الَّذِي جَعَلَ فِي السَّمَاء بُرُوجاً وَجَعَلَ فِيهَا سِرَاجاً وَقَمَراً مُّنِيراً
He hath placed therein a great lamp and a moon giving light (al-Furqān 25:61).
There is in this verse an indication that the sun is the highest of the material lights and that other lights are outpourings from it: similarly the Prophet is the highest of the spiritual lights and other lights are derived from him by virtue of his mediating connection and pivotal rank in the overall sphere of creation. This is also inferred from the tradition, “The first thing Allāh created is my light.”
Allāh (swt)s giving an example of His Light―not of His Essence. Allāh here is not describing Himself; for nothing can describe His Essence. Rather, He is describing one of His Attributes―an-Nūr―a name that reveals His Light. Here the light of the Prophet (s), which was the source of creation, the source of the light of the heavens and earth, is compared to a lighted bundle holding an instrument that gives light and that light is the Prophet (s). “The lamp is in a glass.” That light is contained inside the form of glass. “The glass is as it were a shining star.” That is not ordinary glass. Rather it is like a star created from ad-durr, a very expensive gem, or lu’lu’, which is a type of pearl. This description is used to accentuate the greatness of that light. He said, “the lamp is in a glass,” the lamp is shining in the glass, and “the glass is as it were a shining star.” It means that the light within has not yet emerged.
Still, that reality of the Prophet, the haqīqat al-Muhammadīyya, illumined, pearl-like, a veritable constellation glowing, “as if it were a shining star” remains within. That light of the Prophet (s) is the light of Muhammadun rasūlullah. That is al-haqīqat ul-Muhammadīyya, the Muhammadan Reality, whose internal character signifies that it reflects the Heart of the Essence, since the Prophet’s heart moves without restriction in the orbit of the ninety-nine Names and Attributes. He has been blessed by being adorned by the ninety-nine Names inside of which is a glowing pearl not yet come forth. So the Muhammadan Reality has never appeared―it is still hidden and it is not emerging. But what is manifested in this life is Muhammadun rasūlullāh. Thus Lā ilāha ill-Allāh in the testimony of faith, represents the Creator and Muhammadun rasūlullāh symbolizes the entirety of creation.
Al-Khātib Abū al-Rab‘i Muhammad ibn al-Layth in his book Shifā’ al-sudūr says:
The first thing Allāh created is the light of Muhammad (s) and that light came and prostrated before Allāh. Allāh divided it into four parts and created from the first part the Throne, from the second the Pen, from the third the Tablet, and then similarly He subdivided the fourth part into parts and created the rest of creation. Therefore the light of the Throne is from the light of the Prophet (s), the light of the Pen is from the light of the Prophet (s), the light of the Tablet is from the light of the Prophet (s), the light of day, the light of knowledge, the light of the sun and the moon, and the light of vision and sight are all from the light of the Prophet (s). 
عن ابن عباس: إنّ قريشا (في بعض النسخ: روحه يعني الرسول صلى الله عليه) كانت نورا بين يدي الله تعالى قبل ان يخلق آدم بألفي عام. يسبّح ذلك النور، و تسبّح الملائكة بتسبيحه، فلما خلق الله آدم ألقى ذلك النور في صلبه (ابن أبي عمر العدني في مسنده)Ibn ‘Abbās (r) said: Verily the spirit of the Prophet (s) was a light in front of Allāh two thousand years before he created Adam. That light glorified Him and the angels joined in its glorification. When Allāh created Adam, he cast that light into his loins.
‘Alī ibn al-Husayn (r) related from his father (r), who related from his grandfather said that the Prophet (s) said: I was a light in front of my Lord for fourteen thousand years before He created Adam. It is this light, which was sent to this earth, which became manifest when the Prophet was born.
Al-Qurtubī says: “Kindled from a blessed tree, an olive,” can be taken to refer to the Prophets, in which case Adam would be the blessed tree, or Ibrahim because Allāh called him “blessed.” It is that blessed familial tree from which its most blessed fruit, our master Prophet Muhammad (s) was born.
Imām as-Suyūtī said in al-Riyād al-aniqa: Ibn Jubayr (r) and K‘ab al-Āhbar (r) said, “What is meant by the second light [in “light upon light”] is the Prophet (s) because he is the Messenger and the Expositor and the Conveyor from Allāh of what is enlightening and manifest.” K‘ab, referring to “whose oil would almost glow forth (of itself) though no fire touched it” said, “Its oil well nigh would shine because the Prophet well nigh would be known to the people even if he did not say that he was a Prophet, just as that oil would send forth light without a fire.” In that regard the Prophet (s) said, “The night I was delivered my mother saw a light that lit the castles of Damascus so that she could see them.”
The light of the Prophet (s) is the source of the light of all believers, for while all things were created from his light, the believers were created in a special way. Al-Qurtubī relates in Jam‘ li-ahkām al-qur’ān from Anas (r) who said that the Prophet (s) said:
Allāh created me from light and He created Abū Bakr from my light, and He created ‘Umar and ‘A'isha from the light of Abū Bak(s), and He created the male believers of my community from the light of ‘Umar and He created the female believers of my community from the light of ‘A'isha, Whoever does not love me or love Abū Bakr, ‘Umar and ‘A'isha has no light.
 ‘Abd al-Razzāq (d. 211) narrates it in his Musannaf. Bayhaqī (d. 458) narrates it with a different wording in Dalā'il al-nubūwwa according to Zurqāni in his Sharh al-mawāhib (1:56 of the Matbā‘a al-‘amira in Cairo) and Diyārbakrī in Tārīkh al-khāmis (1:20).
 See Ibn Sa‘d Tabaqāt (Leiden: 1909) voll. I/1, page 96; Cf. Tabarī, Tafsīr, (Cairo: 1323 AH) vol. xxi, page 79.
Shaykh ‘Abd al-Qādir Jilānī, Sirr al-asrār fi mā yahtāju ilayh al-abrār p. 12-14 of the Lahore edition. This book has now been translated by Shaykh Tosun Bayrak al-Jerrahi as The Secret of Secrets (Cambridge: Islamic Texts Society, 1994).
 Al-Qurtubī:Jam' li-ahkām al-qur’ān
 Sharh al-shifā’ (1:505). Cited in Ibn al-Hajj al-Abdarī’s (Muhammad ibn Muhammad d. 736) book al-Madkhal from 2:34 of the edition published by Dar al-kitāb al-‘arabī, Beirut.
 Suyūtī said in Manāhil al-safa (p. 53 #128): “Ibn Abi ‘Umar al-‘Adanī relates it in his Musnad.” In Takhrīj ahādīth sharh al-mawāqif (p. 32 #12) Suyūtī cites it with the wording: “The Quraysh were a light in front of Allāh.”
 Something similar is narrated by Imām Āhmad in his Fadā'il al-sahāba (2:663 #1130), Dhahabī in Mīzān al-i’tidāl (1:235), and al-Tabarī in al-Riyād al-nādirā (2:164, 3:154).
 Narrated by al-Hākim in his Mustadrak (2:616-617), Āhmad in his Musnad (4:184), and Bayhaqī in Dalā'il al-nubūwwa (1:110, 2:8). Ibn al-Jawzī cites it in al-Wafā' (p. 91, ch. 21 of Bidāyat nabīyyina sall-Allāhu ‘alayhi wa sallam), and Ibn Kathīr in Mawlid rasūl Allāh and his Tafsīr (4:360). Haythamī cites it in Majma’ al-zawā’id (8:221) and said Tabarānī and Āhmad narrated it, and Āhmad's chain is fair (hasan). See for Āhmad's complete text Bishāratu ‘Isā (#454).