The Messenger of Allah ﷺ said, "When one of you is praying, he must not allow anyone to pass in front of him. If the person refuses, then let him fight him off."
أخبرنا قتيبة عن مالك عن زيد بن أسلم عن عبد الرحمن بن أبي سعيد
أن رسول الله ﷺ قال إذا كان أحدكم يصلي فلا يدع أحدا أن يمر بين يديه فإن أبى فليقاتله
Muslim narrated it, no. 505. See also the previous hadith from Malik's narration through the same route. It is found in Muwatta (Yahya's recension), 1/154, and in Kubra, no. 833.