The Messenger of Allah ﷺ reported that Sulayman bin Dawud ﷺ, when he completed the building of Bayt al-Maqdis, asked Allah for three things. He asked Allah
for judgment that would conform to His judgment, and he was granted it. He asked Allah
for a kingdom that would not befit anyone after him, and he was granted it. And he asked Allah
, when he had finished building the mosque, that no one would come to it intending nothing but prayer within it except that he would leave free of his sins as on the day his mother bore him.
عن رسول الله: أن سليمان بن، ﷺ: أن داود ﷺ لما بنى بيت المقدس سأل الله عز وجل خلالا ثلاثة: سأل الله عز وجل حكما يصادف حكمه فأوتيه، وسأل الله عز وجل ملكا لا ينبغي لأحد من بعده فأوتيه، وسأل الله عز وجل حين فرغ من بناء المسجد أن لا يأتيه أحد لا ينهزه إلا الصلاة فيه أن يخرجه من خطيئته كيوم ولدته أمه.
Nasai (693) narrated it from Amr bin Mansur, who said, Abu Mishar told us, who said, Saeed bin Abdul-Aziz told us, from Rabia bin Yazid, from Abu Idris Khawlani, from Ibn Daylami, from Abdullah bin Amr, who said, then he mentioned it. Its chain of transmission is sahih.Ibn Daylami is Abdullah bin Firuz Daylami, Abu Bishr. Ibn Main, Ajli, Ibn Hibban, and others deemed him reliable. The hadith has other paths of transmission, as mentioned before.