The Prophet ﷺ said, "If while you are praying, somebody intends to pass in front of you, prevent him; and should he insist, prevent him again; and if he insists again, fight with him (i.e. prevent him violently e.g. pushing him violently), because such a person is (like) a devil."
قَالَ النَّبِيُّ ﷺ إِذَا مَرَّ بَيْنَ يَدَىْ أَحَدِكُمْ شَىْءٌ وَهُوَ يُصَلِّي فَلْيَمْنَعْهُ فَإِنْ أَبَى فَلْيَمْنَعْهُ فَإِنْ أَبَى فَلْيُقَاتِلْهُ فَإِنَّمَا هُوَ شَيْطَانٌ