Allah, Subhanahu wa Ta’ala, had granted Nabi Sulayman (‘a) special knowledge whereby he could control the wind, understand the speech of other creatures on the earth, including the jinns and other invisible creatures.
Nabi Sulayman (‘a) had made a Du’a:
رَبِّ اغْفِرْ لِي وَهَبْ لِي مُلْكاً لا يَنْبَغي لِأَحَدٍ مِنْ بَعْدي إِنَّكَ أَنْتَ الوَهَّابُ
“O my Rabb! Pardon me and bestow upon me a kingdom such as shall not become of anyone after me. Truly You are the Most Generous Bestower.” (38:35).
In Surah an-Naml we read that when Nabi Sulayman (‘a) was marching with his armies of Jinns, mankind and birds, they came across a valley of ants. An ant exclaimed!
حَتَّىٰٓ إِذَآ أَتَوۡاْ عَلَىٰ وَادِ ٱلنَّمۡلِ قَالَتۡ نَمۡلَةٌ۬ يَـٰٓأَيُّهَا ٱلنَّمۡلُ ٱدۡخُلُواْ مَسَـٰكِنَڪُمۡ لَا يَحۡطِمَنَّكُمۡ سُلَيۡمَـٰنُ وَجُنُودُهُ وَهُمۡ لَا يَشۡعُرُونَ
“At length, when they came to a (lowly) valley of ants, one of the ants said: "O ye ants get into your habitations, lest Solomon and his hosts crush you (under foot) without knowing it." (27:18).
Upon hearing this, Nabi Sulayman (‘a) smiled and did this beautiful Du’a:
فَتَبَسَّمَ ضَاحِكً۬ا مِّن قَوۡلِهَا وَقَالَ رَبِّ أَوۡزِعۡنِىٓ أَنۡ أَشۡكُرَ نِعۡمَتَكَ ٱلَّتِىٓ أَنۡعَمۡتَ عَلَىَّ وَعَلَىٰ وَٲلِدَىَّ وَأَنۡ أَعۡمَلَ صَـٰلِحً۬ا تَرۡضَٮٰهُ وَأَدۡخِلۡنِى بِرَحۡمَتِكَ فِى عِبَادِكَ ٱلصَّـٰلِحِينَ
“So he smiled, amused at her speech; and he said: "O my Lord! so order me that I may be grateful for Thy favours which Thou hast bestowed on me and on my parents and that I may work the righteousness that will please Thee: and admit me by Thy Grace, to the ranks of Thy righteous Servants." (27:19).
Allah, Subhanahu wa Ta’ala, reveals how Nabi Sulayman (‘a) became instrumental in inviting the Queen of Sheba to the worship of only One God, Allah.
The Qur’an tells us that a Hoopoe (a bird) informs Nabi Sulayman (‘a) about a Queen and her magnificent throne and the enormous wealth she and her subjects enjoyed. But they were fire worshippers. Nabi Sulayman (‘a) sent her a letter in the name of Allah, inviting her. In order to impress Nabi Sulayman (‘a) she sent him gifts from her kingdom. The episode takes an interesting turn as Nabi Sulayman (‘a) would not accept her gift. She visited Nabi Sulayman (‘a) and was very impressed with what she saw. She realized the falsehood of worshipping fire and accepted Islam.
She was invited by Nabi Sulayman (‘a) to enter his lofty palace. When she saw the shining floor of the palace, she thought it was a lake of water. She lifted her skirts to enter. This uncovered her legs. She realized at once that it was not a lake of water but a shining floor, paved smooth with slabs of glass. She felt not only embarrassed but also that she had wronged her soul for not having known the truth of life that life should be spent in submission to the One who truly is the Rabb al-’Alamin, the Sustainer and the Cherisher of the universe!
She recited this beautiful Du’a:
رَبِّ إِنِّي ظَلَمْتُ نَفْسي وَأَسْلَمْتُ مَعَ سُلَيْمانَ لِلَّهِ رَبِّ العالَمينَ
“O my Rabb! Truly I have wronged my soul, and I do (now) surrender myself with Sulayman to the Will of Allah, the Rabb of the Universe.” (27:44).