Abdullah bin Amr bin As reported,

The Prophet ﷺ said that whenever he entered the mosque, he would say, "I seek refuge in Allah the Magnificent, in His Noble Face, and in His Eternal Authority, from the accursed Satan."The narrator was asked, "Is that all?"He replied, "Yes."The Prophet ﷺ said, "When he says that, Satan says, 'He is protected from me for the rest of the day.'"

Abu Dawud 466

Sahih

حدثنا إسمعيل بن بشر بن منصور حدثنا عبد الرحمن بن مهدي عن عبد الله بن المبارك عن حيوة بن شريح قال لقيت عقبة بن مسلم فقلت له بلغني أنك حدثت

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

عن النبي ﷺ أنه كان إذا دخل المسجد قال أعوذ بالله العظيم وبوجهه الكريم وسلطانه القديم من الشيطان الرجيم قال أقط قلت نعم قال فإذا قال ذلك قال الشيطان حفظ مني سائر اليوم

أبو داود 466صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Prayer
Chapter
What a man says when entering the masjid
Numbering
Darussalam 466
Abu Dawud 466