In order for a war to be just, three things are necessary: a ruler’s authority, a just cause, and a right intention. Killing an attacker can be lawful if you mean to save your life and not to kill. Nothing hinders one act from having two effects. From Summa Theologica by Thomas Aquinas Save Share