Abdullah bin Amr bin As reported,

The Messenger of Allah ﷺ said that when Sulayman bin Dawud finished building Bayt al-Maqdis, he asked Allah عز وجل for three things. He asked Allah عز وجل for judgment that would correspond to His own 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 completed the construction of the mosque, he asked Allah عز وجل that no one should come to it intending nothing but prayer within it except that he would emerge from his sins as on the day his mother bore him.

Azami 13179

Sahih

عن عبد الله بن عمرو

عن رسول الله ﷺ: أن سليمان بن داود لما بنى بيت المقدس سأل الله عز وجل خلالا ثلاثة: سأل الله عز وجل حكما يصادف حكمه، فأوتيه، وسأل الله عز وجل ملكا لا ينبغي لأحد من بعده، فأوتيه، وسأل الله عز وجل حين فرغ من بناء المسجد: أن لا يأتيه أحد لا ينهزه إلا الصلاة فيه أن يخرجه من خطيئته كيوم ولدته أمه.

الأعظمي 13179صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Sad
Section
His saying, "My Lord, forgive me and my brother and admit us into Your mercy, for You are the most merciful of the merciful. Indeed, those who took the calf, anger from their Lord will reach them"
Numbering
Jami al-Kamil 13179 (2nd edition)
Azami 13179