وَلَا يُقَاتِلُونَ فِي حَالِ الصَّلَاةِ، فَإِنْ فَعَلُوا ذَلِكَ: بَطَلَتْ صَلَاتُهُمْ
Translation: They must not engage in fighting during prayer; if they do so, their prayer becomes invalid.
This ruling concerns the organized form where one group can pray while the other guards. Active fighting within the prayer is extensive action that invalidates it.
Guarding while not praying is distinct from engaging in combat during prayer itself.