Mishkat al-Masabih 749
وَعَنْ عَبْدِ اللَّهِ بْنِ عَمْرِو بْنِ الْعَاصِ قَالَ: كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ إِذا دخل الْمَسْجِد قَالَ: «أَعُوذُ بِاللَّهِ الْعَظِيمِ وَبِوَجْهِهِ الْكَرِيمِ وَسُلْطَانِهِ الْقَدِيمِ مِنَ الشَّيْطَانِ الرَّجِيمِ» قَالَ: «فَإِذَا قَالَ ذَلِكَ قَالَ الشَّيْطَان حفظ مني سَائِر الْيَوْم» . رَوَاهُ أَبُو دَاوُد
And from ʿAbdullah ibn ʿAmr ibn al-ʿAs, who said: When the Messenger of Allah ﷺ entered the mosque, he would say: "I seek refuge in Allah the Magnificent, in His noble Face and His eternal authority, from Satan the accursed." He said: "When he says that, Satan says: 'He has been protected from me for the rest of the day.'" Reported by Abu Dawud.