Abu Saeed Khudri reported,

Abu Saeed was praying when a son of Marwan passed in front of him. He pushed the boy back, but the boy did not retreat, so he struck him. The boy left crying and went to Marwan and told him what had happened.Marwan said to Abu Saeed, "Why did you strike your nephew?"He replied, "I did not strike him. I only struck Satan. I heard the Messenger of Allah ﷺ say, 'When one of you is praying and someone tries to pass in front of him, let him push the person back as much as he can. If the person refuses, let him fight him, for he is a devil.'"

Nasai 4866

Sahih

أخبرنا محمد بن مصعب قال حدثنا محمد بن المبارك قال حدثنا عبد العزيز بن محمد عن صفوان بن سليم عن عطاء بن يسار

عن أبي سعيد الخدري

أنه كان يصلي فإذا بابن لمروان يمر بين يديه فدرأه فلم يرجع فضربه فخرج الغلام يبكي حتى أتى مروان فأخبره فقال مروان لأبي سعيد لم ضربت ابن أخيك قال ما ضربته إنما ضربت الشيطان سمعت رسول الله ﷺ يقول إذا كان أحدكم في صلاة فأراد إنسان يمر بين يديه فيدرؤه ما استطاع فإن أبى فليقاتله فإنه شيطان

النسائي 4866صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Sworn testimony
Chapter
Taking one's right and retribution without the ruler
Numbering
Darussalam 4866
Nasai 4866