The Messenger of Allah ﷺ said, "When Sulayman bin Dawud ﷺ built Bayt al-Maqdis, he asked Allah, the Mighty and Majestic, for three things. He asked Allah for judgment that would align with His judgment, and it was granted to him. He asked Allah for a kingdom that would not be fitting for anyone after him, and it was granted to him. And when he finished building the mosque, he asked Allah, the Mighty and Majestic, that whoever came to it intending nothing but prayer within it would emerge from his sins as on the day his mother bore him."
عن رسول الله ﷺ قال: إن سليمان ابن داود ﷺ لما بنى بيت المقدس سأل الله عزوجل خلالا ثلاثة: سأل الله عزوجل حكما يصادف حكمه فأوتيه، وسأل الله عزوجل ملكا لا ينبغي لأحد من بعده فأوتيه، وسأل عزوجل حين فرغ من بناء المسجد أن لا يأتيه أحد لا ينهزه إلا الصلاة فيه أن يخرجه من خطيئته كيوم ولدته أمه.
Nasai (693) narrated it from Amr bin Mansur, who said, Abu Mishar narrated to us, who said, Saeed bin Abdul-Aziz narrated to us, from Rabia bin Yazid, from Abu Idris Khawlani, from Ibn Daylami, from Abdullah bin Amr, and he related it.Its chain is sahih, and Ibn Daylami is Abdullah bin Firuz Daylami, Abu Bishr, whom Ibn Main, Ajli, Ibn Hibban, and others deemed reliable.